Skip to content

Instantly share code, notes, and snippets.

@icot
Created January 11, 2013 11:03
Show Gist options
  • Save icot/4509863 to your computer and use it in GitHub Desktop.
Save icot/4509863 to your computer and use it in GitHub Desktop.
Fabric fabfile for syscontrol tasks
from fabric.api import run, hosts,env
import logging
logging.basicConfig( level=logging.ERROR )
env['use_ssh_config'] = True
SVN_USER = 'XXXXXXXX'
BASE_PATH = """ $DISTRIBUTE_TOP/dist_top_syscontrol/projects/dod/ """
@hosts('XXXXXX')
def svn_update():
run( """cd %s ; svn --username %s update """ % (BASE_PATH, SVN_USER ))
@hosts('XXXXXX')
def distribute():
run( """ $DISTRIBUTE_SCRIPT dist_top_syscontrol """ )
@hosts('XXXXXX')
def copy_to_prod(path):
if path:
run( """ export SVN_USER=%s; cd %s ; copy_to_prod %s """ %
(SVN_USER, BASE_PATH, path))
else:
print("Required file path relative to %s " % BASE_PATH)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment