I think the sudo is causing your problems. As long as your initial
clone has (had) the correct permissions and you pull and update as www-
data you should be fine. An unspecified "sudo" makes the owner of the
files root.

Something like this should give you the results you are seeking:

def update(app):
    '''
    cmd example:

        deploy:my_application
    '''
    with cd ('/var/web2py/applications/%(app)s'):
        run('hg pull')
        run('hg update')
    sudo('/etc/init.d/cherokee restart')

On Feb 19, 8:00 pm, pbreit <pbreitenb...@gmail.com> wrote:
> I'm not sure if it's a hook or not but I'll just try adding a chown command
> to my deploy function. I was already specifying user='www-data' on the pull
> but am not sure if that does anything.
>
> def deploy():
>     sudo('cd /var/web2py/applications/%s; hg pull' % (app), user='www-data')
>     sudo('cd /var/web2py/applications/%s; hg update' % (app))
>     sudo('chown -R www-data:www-data /var/web2py')
>     sudo('/etc/init.d/cherokee restart')

Reply via email to