vcppp_p
October 22nd, 2009, 05:56 PM
Hi
my machine is running both SVN and HTTP server.
I need a "trick" to export the files from the repository to /var/www each time anyone commits the changes to the repo. Therefore I found and adopted the following script:
#!/bin/sh
# Delete Old site
rm --interactive=never -R /var/www/site
# Export Repository
svn export --force file:///var/svn/site/var/www/site
# Make sure Apache Owns the website
chown -R www-data:www-data /var/www/site
chmod 777 /var/www/site/cache
chmod 777 /var/www/site/logs
chmod 777 /var/www/site/data.sqlite
chmod 777 /home/www/kohana/sites/portfolio/data/stats.sqlite
unfortunately, chown requires root privilages. The problem is that without setting proper chmods and chowns my app won't work, and setting them obviously fails as the script is being run automaticaly by svn server (user svn, group: svn). I need to set the file's chown to www-data somehow... how can I do that?
thanks in advance
my machine is running both SVN and HTTP server.
I need a "trick" to export the files from the repository to /var/www each time anyone commits the changes to the repo. Therefore I found and adopted the following script:
#!/bin/sh
# Delete Old site
rm --interactive=never -R /var/www/site
# Export Repository
svn export --force file:///var/svn/site/var/www/site
# Make sure Apache Owns the website
chown -R www-data:www-data /var/www/site
chmod 777 /var/www/site/cache
chmod 777 /var/www/site/logs
chmod 777 /var/www/site/data.sqlite
chmod 777 /home/www/kohana/sites/portfolio/data/stats.sqlite
unfortunately, chown requires root privilages. The problem is that without setting proper chmods and chowns my app won't work, and setting them obviously fails as the script is being run automaticaly by svn server (user svn, group: svn). I need to set the file's chown to www-data somehow... how can I do that?
thanks in advance