diff --git a/builder/monitor.py b/builder/monitor.py index fa0df2e..f44464f 100644 --- a/builder/monitor.py +++ b/builder/monitor.py @@ -95,6 +95,10 @@ class Builder(RedisBase): def clone(self): """clone repo to destination""" + if not self.task_detail["clone"]: + print("skip clone") + return + print("clone repo") repo_dir = os.path.join(self.CLONE_BASE, self.task_detail["name"]) if os.path.exists(repo_dir): @@ -106,8 +110,12 @@ class Builder(RedisBase): def build(self): """build the container""" - build_command = ["docker", "buildx"] + self.task_detail["build"] - build_command.append(os.path.join(self.CLONE_BASE, self.task)) + if not self.task_detail["clone"]: + build_command = self.task_detail["build"] + else: + build_command = ["docker", "buildx"] + self.task_detail["build"] + build_command.append(os.path.join(self.CLONE_BASE, self.task)) + subprocess.run(build_command, check=True) def remove_task(self): diff --git a/tubearchivist/web/src/webhook_github.py b/tubearchivist/web/src/webhook_github.py index 4095e23..4386ce4 100644 --- a/tubearchivist/web/src/webhook_github.py +++ b/tubearchivist/web/src/webhook_github.py @@ -427,6 +427,8 @@ class TaskHandler(RedisBase): "name": self.repo_conf.get("gh_repo"), "build": build_command, } + if task_name == "sync_es": + task.update({"clone": False}) self.conn.json().set(self.key, f".tasks.{repo}", task)