def handle_pull_request(self, ctx, name, target_filename, packages_str, tools_str, base_image, **kwds): if self.do_pull_request: message = kwds["message"] message = string.Template(message).safe_substitute({ "hash": name, "packages": packages_str, "tools": tools_str, "base_image": base_image, }) branch_name = name.replace(":", "-") branch(ctx, self.target_repository, branch_name, from_branch="master") add(ctx, self.target_repository, target_filename) commit(ctx, self.target_repository, message=message) force_push = kwds.get("force_push", False) push(ctx, self.target_repository, os.environ.get("GITHUB_USER"), branch_name, force=force_push) pull_request(ctx, self.target_repository, message=message)
def handle_pull_request(self, ctx, name, target_filename, **kwds): if self.do_pull_request: message = kwds["message"] % name branch_name = name branch(ctx, self.target_repository, branch_name, from_branch="master") add(ctx, self.target_repository, target_filename) commit(ctx, self.target_repository, message=message) force_push = kwds.get("force_push", False) push(ctx, self.target_repository, os.environ.get("GITHUB_USER"), branch_name, force=force_push) pull_request(ctx, self.target_repository, message=message)
def add_dir_contents_to_repo(ctx, from_dir, target_dir, target_repository_path, version, dry_run, notes=""): ctx.log("From {} to {}".format(from_dir, target_repository_path)) rm_dir_contents(target_repository_path) copy_tree(from_dir, target_repository_path) git.add(ctx, target_repository_path, target_repository_path) message = "Update for version {version}".format(version=version) if notes: message += "\n{notes}".format(notes=notes) git.commit(ctx, repo_path=target_repository_path, message=message) if not dry_run: git.push(ctx, target_repository_path)
def handle_pull_request(self, ctx, name, target_filename, packages_str, tools_str, **kwds): if self.do_pull_request: message = kwds["message"] message = string.Template(message).safe_substitute({ "hash": name, "packages": packages_str, "tools": tools_str, }) branch_name = name.replace(":", "-") branch(ctx, self.target_repository, branch_name, from_branch="master") add(ctx, self.target_repository, target_filename) commit(ctx, self.target_repository, message=message) force_push = kwds.get("force_push", False) push(ctx, self.target_repository, os.environ.get("GITHUB_USER"), branch_name, force=force_push) pull_request(ctx, self.target_repository, message=message)