def git_deploy(appname, repo):
 appfolder = ((applications + '/') + appname)
 backup = mkdir_or_backup(appname)
 if exists(appfolder):
  with cd(appfolder):
   sudo('git pull origin master')
   sudo('chown -R www-data:www-data *')
 else:
  with cd(applications):
   sudo(('git clone git@github.com/%s %s' % (repo, name)))
   sudo(('chown -R www-data:www-data %s' % name))

def git_deploy ( appname , repo ) : appfolder = ( ( applications + '/' ) + appname ) backup = mkdir_or_backup ( appname ) if exists ( appfolder ) : with cd ( appfolder ) : sudo ( 'git pull origin master' ) sudo ( 'chown -R www-data:www-data *' ) else : with cd ( applications ) : sudo ( ( 'git clone git@github.com/%s %s' % ( repo , name ) ) ) sudo ( ( 'chown -R www-data:www-data %s' % name ) )
fab -h username@host git_deploy:appname .