def exists(configuration, env, branch): # Init Fabric fabric_initer(configuration, env) # Params branch_slug = utils.slugify(branch) domain_path = utils.get_workspace_path(configuration, env, branch) #Load configuration if api.env.role == "local": return False else: return ffiles.exists(workspace_path + "/" + branch_slug)
def clone(configuration, env, branch): # fabric_initer(configuration, env) # branch_slug = utils.slugify(branch) workspace_path = utils.get_workspace_path(configuration, env, branch) if api.env.role == "local": return False else: with api.cd(workspace_path): api.run("git clone --depth 1 %s -b %s ." % (configuration["project"]["repository"], branch)) return True
def pull(configuration, env, branch="develop"): # fabric_initer(configuration, env) # branch_slug = utils.slugify(branch) workspace_path = utils.get_workspace_path(configuration, env, branch) if api.env.role == "local": api.local("git pull origin %s" % branch) return True else: with api.cd(workspace_path): api.run("git pull origin %s" % branch) return True
def bake(configuration, recipes, env, branch="develop"): """ Bake branch Bake """ # Init Fabric fabric_initer(configuration, env) # Params branch_slug = utils.slugify(branch) workspace_path = utils.get_workspace_path(configuration, env, branch) if install(configuration, recipes, env, branch): return True return False
def post_install(configuration, recipes, env, branch): # Init Fabric fabric_initer(configuration, env) # Params branch_slug = utils.slugify(branch) workspace_path = utils.get_workspace_path(configuration, env, branch) if api.env.role == "local": return False else: with api.cd(workspace_path): recipe_type = configuration[env]["app"]["type"] pprint.pprint(recipe_type) pprint.pprint(recipes) recipe_post_install = None api.run("sh %s" % recipe_post_install)
def exists(configuration, env, branch="develop"): """ Repository exists branch Test repository existence """ # Init Fabric fabric_initer(configuration, env) # Params branch_slug = utils.slugify(branch) workspace_path = utils.get_workspace_path(configuration, env, branch) if api.env.role == "local": return False else: if not workspace_path: return False else: return ffiles.exists(workspace_path + "/.git")