This commit is contained in:
ahmadbilalkhalid 2019-08-28 20:42:57 +05:00
parent 1259216e86
commit 6cb7b1bacf

View file

@ -1,6 +1,7 @@
import click
import subprocess
import os
import shutil
from app.helper import (
clone,
@ -36,8 +37,10 @@ def setup(path, auth_name, auth_seed, auth_realm,
etcd_password):
os.chdir(path)
repo_name = "ucloud-api"
# Git Operation Depends on success of previous operation i.e PackageManagementOperation
op = GitOperation.clone(url="https://code.ungleich.ch/ungleich-public/ucloud-api.git")
op = GitOperation.clone(url=f"https://code.ungleich.ch/ungleich-public/{repo_name}.git")
content = (
f"AUTH_NAME={auth_name}\n"
@ -51,19 +54,20 @@ def setup(path, auth_name, auth_seed, auth_realm,
# FileOperation depends on success of previos operation i.e GitOperation.clone
op.add(
FileOperation.write, path=os.path.join("ucloud-api", ".env"), content=content
FileOperation.write, path=os.path.join(repo_name, ".env"), content=content
)
op.add(
GitOperation.clone,
path="ucloud-api",
path=repo_name,
url="https://code.ungleich.ch/ungleich-public/ucloud_common",
)
op.add(
GitOperation.clone,
path="ucloud-api",
path=repo_name,
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
)
os.add(shutil.copytree, src=os.path.join(repo_name, "etcd3_wrapper"),
dest=os.path.join(repo_name, "ucloud_common"))
op.add(PipenvOperation.install, path="ucloud-api")