Created
January 11, 2013 11:03
-
-
Save icot/4509863 to your computer and use it in GitHub Desktop.
Fabric fabfile for syscontrol tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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