def deploy_project(user = None, passwd = None, http = True): ''' If `user` and/or `passwd` given, use them to authenticate when cloning via http. If not `http` clone via normal git url. ''' # bool casting http = FabUtil.str2bool(http) with settings(warn_only=True): # only clone if dir not already exists if run("test -d %s" % CODE_DIR).failed: git_url = FabUtil.build_git_http_url(user, passwd) if http else REPO_PATH_GIT_URL run("git clone %s" % git_url) # update repository with cd(CODE_DIR): run("git pull")
def deploy_project(user=None, passwd=None, http=True): ''' If `user` and/or `passwd` given, use them to authenticate when cloning via http. If not `http` clone via normal git url. ''' # bool casting http = FabUtil.str2bool(http) with settings(warn_only=True): # only clone if dir not already exists if run("test -d %s" % CODE_DIR).failed: git_url = FabUtil.build_git_http_url( user, passwd) if http else REPO_PATH_GIT_URL run("git clone %s" % git_url) # update repository with cd(CODE_DIR): run("git pull")