a
This commit is contained in:
parent
1259216e86
commit
6cb7b1bacf
1 changed files with 10 additions and 6 deletions
16
app/api.py
16
app/api.py
|
@ -1,6 +1,7 @@
|
||||||
import click
|
import click
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
from app.helper import (
|
from app.helper import (
|
||||||
clone,
|
clone,
|
||||||
|
@ -35,9 +36,11 @@ def setup(path, auth_name, auth_seed, auth_realm,
|
||||||
realm_allowed, otp_server, etcd_url,
|
realm_allowed, otp_server, etcd_url,
|
||||||
etcd_password):
|
etcd_password):
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
|
repo_name = "ucloud-api"
|
||||||
|
|
||||||
# Git Operation Depends on success of previous operation i.e PackageManagementOperation
|
# 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 = (
|
content = (
|
||||||
f"AUTH_NAME={auth_name}\n"
|
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
|
# FileOperation depends on success of previos operation i.e GitOperation.clone
|
||||||
op.add(
|
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(
|
op.add(
|
||||||
GitOperation.clone,
|
GitOperation.clone,
|
||||||
path="ucloud-api",
|
path=repo_name,
|
||||||
url="https://code.ungleich.ch/ungleich-public/ucloud_common",
|
url="https://code.ungleich.ch/ungleich-public/ucloud_common",
|
||||||
)
|
)
|
||||||
|
|
||||||
op.add(
|
op.add(
|
||||||
GitOperation.clone,
|
GitOperation.clone,
|
||||||
path="ucloud-api",
|
path=repo_name,
|
||||||
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
|
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")
|
op.add(PipenvOperation.install, path="ucloud-api")
|
||||||
|
|
Loading…
Reference in a new issue