mirror of
https://github.com/tubearchivist/tubearchivist-server.git
synced 2024-12-22 18:00:17 +00:00
optionally skip clone and call subprocess directly
This commit is contained in:
parent
14cfbea287
commit
d63e5bc407
@ -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):
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user