Goal: update /var/www
with latest on svn commit.
ubuntu server 10.10, latest apache2, latest svn, location: /var/svn/[projectname]
To do this I created a simple post-commit script:
#!/bin/bash
#tests if www-data user runs this script on commit (which it does)
touch /tmp/test.log
#works when run from the command line (sudo ./post-commit) but not when run by www-data
sudo /usr/bin/svn update /var/www
To fix the issue of the second command not working as www-data I tried...
Editing: sudo visudo
and added (at the end): www-data ALL=(ALL) NOPASSWD:ALL
Chowning: /var/www
to www-data:www-data
Chmoding: all of /var/www
to 777
Still no luck... any ideas?