def configure(): '''setup git on hosts''' run('git config --global user.email "*****@*****.**"') run('git config --global user.name "Fake Name"') for repo, branch in [('cassandra', 'cassandra-2.1'), ('YCSB', 'master')]: repo_url = "ssh://" + SERVER_URL + path.join(BASE_GIT_DIR, repo) run_with_retry("git clone {repo_url}".format(**locals())) with cd(repo): run("git checkout {branch}".format(**locals()))
def compile_code(): '''clean and compile cassandra code''' with cd(CODE_DIR): with hide('stdout'): run("ant -q clean > /dev/null") run_with_retry("ant -q")
def _get_code(branch, working_dir): with cd(working_dir): run("git reset --hard") run("git checkout .") run_with_retry("git fetch -q -a") run("git checkout -q {branch}".format(**locals()))