def checkout_adam(fork='bigdatagenomics', branches=[]): """ Makes a fresh checkout of ADAM from github. Applies requested branches. Branch list should contain either tuples of two strings where the first string is the repository and the second string is the branch, or strings, where the string is the branch to merge. """ run('rm -rf adam') run('git clone https://www.github.com/%s/adam.git' % fork) cd('adam') # apply pull requests run('git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"' ) for branch in branches: if isinstance(branch, basestring): run('git merge %s' % branch) elif isinstance(branch, tuple): run('git pull %s %s' % branch) elif not confirm( 'Unsure how to process %s, not a string or tuple. Continue anyways?' % str(branch)): abort('Aborting at user request.') # cd to top cd('..')
def uninstall(): """Uninstall python""" version = get_config()['version'] install_dir = os.path.join(_INSTALL_DIR, 'python') if version != 'all': install_dir = os.path.join(install_dir, version) fab.puts("Removing {0}".format(install_dir)) if fab.confirm("Are you sure?", default=False): fab.sudo("rm -rf '{0}'".format(install_dir)) fab.puts("Python {0} uninstalled".format(version))
def uninstall(): """Uninstall nginx HTTP server""" version = get_config()['version'] install_dir = os.path.join(_INSTALL_DIR, 'nginx') if version != 'all': install_dir = os.path.join(install_dir, version) fab.puts("Removing {0}".format(install_dir)) if fab.confirm("Are you sure?", default=False): fab.sudo("rm -rf '{0}'".format(install_dir)) fab.puts("Nginx {0} uninstalled".format(version))
def checkout_adam(fork='bigdatagenomics', branches=[]): """ Makes a fresh checkout of ADAM from github. Applies requested branches. Branch list should contain either tuples of two strings where the first string is the repository and the second string is the branch, or strings, where the string is the branch to merge. """ run('rm -rf adam') run('git clone https://www.github.com/%s/adam.git' % fork) cd('adam') # apply pull requests run('git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"') for branch in branches: if isinstance(branch, basestring): run('git merge %s' % branch) elif isinstance(branch, tuple): run('git pull %s %s' % branch) elif not confirm('Unsure how to process %s, not a string or tuple. Continue anyways?' % str(branch)): abort('Aborting at user request.') # cd to top cd('..')
def put_task(): api.run("mkdir -p /tmp/install") with api.settings(warn_only=True): result = api.put(lpackpath, rpackpath) # 上传安装包 if result.failed and not api.confirm("put file failed, Continue[y/n]?"): api.abort("Aborting file put task")