def deploynobackup(appname=None):
 appname = (appname or os.path.split(os.getcwd())[(-1)])
 appfolder = ((applications + '/') + appname)
 zipfile = os.path.join(appfolder, '_update.zip')
 if os.path.exists(zipfile):
  os.unlink(zipfile)
 local('zip -r _update.zip */*.py */*/*.py views/*.html views/*/*.html static/*')
 put('_update.zip', '/tmp/_update.zip')
 try:
  with cd(appfolder):
   sudo('unzip -o /tmp/_update.zip')
   sudo('chown -R www-data:www-data *')
   sudo(('echo "%s" > DATE_DEPLOYMENT' % now))
 finally:
  sudo('rm /tmp/_update.zip')

def deploynobackup ( appname = None ) : appname = ( appname or os . path . split ( os . getcwd ( ) ) [ ( - 1 ) ] ) appfolder = ( ( applications + '/' ) + appname ) zipfile = os . path . join ( appfolder , '_update.zip' ) if os . path . exists ( zipfile ) : os . unlink ( zipfile ) local ( 'zip -r _update.zip */*.py */*/*.py views/*.html views/*/*.html static/*' ) put ( '_update.zip' , '/tmp/_update.zip' ) try : with cd ( appfolder ) : sudo ( 'unzip -o /tmp/_update.zip' ) sudo ( 'chown -R www-data:www-data *' ) sudo ( ( 'echo "%s" > DATE_DEPLOYMENT' % now ) ) finally : sudo ( 'rm /tmp/_update.zip' )
fab -h username@host deploy:appname .