mirror of
https://github.com/tubearchivist/tubearchivist-server.git
synced 2024-12-22 18:00:17 +00:00
better clone-pull path building
This commit is contained in:
parent
4158bae090
commit
e6ec703eac
@ -96,17 +96,13 @@ class Builder(RedisBase):
|
||||
def clone(self):
|
||||
"""clone repo to destination"""
|
||||
print("clone repo")
|
||||
clone = ["git", "clone", self.task_detail["clone"]]
|
||||
pull = ["git", "pull", self.task_detail["clone"]]
|
||||
os.chdir("clone")
|
||||
try:
|
||||
subprocess.run(clone, check=True)
|
||||
except subprocess.CalledProcessError:
|
||||
print("git pull instead")
|
||||
os.chdir(self.task)
|
||||
subprocess.run(pull, check=True)
|
||||
os.chdir("../")
|
||||
os.chdir("../")
|
||||
repo_dir = os.path.join(self.CLONE_BASE, self.task_detail["name"])
|
||||
if os.path.exists(repo_dir):
|
||||
command = ["git", "-C", repo_dir, "pull"]
|
||||
else:
|
||||
command = ["git", "clone", self.task_detail["clone"], repo_dir]
|
||||
|
||||
subprocess.run(command, check=True)
|
||||
|
||||
def build(self):
|
||||
"""build the container"""
|
||||
|
Loading…
Reference in New Issue
Block a user