def deployBranches(config, branches, modules=None, templates_only=False): if branches: for branch in branches: if git.currentBranch() != branch: git.checkout(branch) deploy(config, branch=branch, modules=modules, templates_only=templates_only) else: deploy(config, modules=modules, templates_only=templates_only)
def determineBranches(config, args): branches = [] if args.branch: branches = [args.branch] elif args.list: if "branch_lists" in config and args.list in config["branch_lists"]: branches = config["branch_lists"][args.list] else: sys.exit("Error: Could not find definition for list '%s' in configuration." % args.list) if not branches and git.installed() and git.isRepository(): branches = [git.currentBranch()] return branches
def deployBranches(config, branches, services=None, templates_only=False): code = 1 # 0 is success, so by default assume the deploy didn't succeed if branches: for branch in branches: if git.currentBranch() != branch: git.checkout(branch) code = deploy(config, branch=branch, services=services, templates_only=templates_only) else: code = deploy(config, services=services, templates_only=templates_only) # note that this only returns the most recent return code