a
This commit is contained in:
parent
2f2c261b65
commit
4f8d3a1485
2 changed files with 28 additions and 27 deletions
38
app/api.py
38
app/api.py
|
@ -22,30 +22,30 @@ def api():
|
||||||
|
|
||||||
def setup(path, auth_name, auth_seed, auth_realm,
|
def setup(path, auth_name, auth_seed, auth_realm,
|
||||||
realm_allowed, otp_server):
|
realm_allowed, otp_server):
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
|
|
||||||
# Install Package
|
# Install Package
|
||||||
op = PackageManagementOperation.install("asdnioasndisa")
|
op = PackageManagementOperation.install("asdnioasndisa")
|
||||||
|
|
||||||
# Git Operation Depends on success of previous operation i.e PackageManagementOperation
|
# Git Operation Depends on success of previous operation i.e PackageManagementOperation
|
||||||
op.add(GitOperation.clone("https://code.ungleich.ch/ungleich-public/ucloud-api.git"))
|
op.add(GitOperation.clone("https://code.ungleich.ch/ungleich-public/ucloud-api.git"))
|
||||||
|
|
||||||
content = f"AUTH_NAME={auth_name}\n" \
|
content = f"AUTH_NAME={auth_name}\n" \
|
||||||
f"AUTH_SEED={auth_seed}\n" \
|
f"AUTH_SEED={auth_seed}\n" \
|
||||||
f"AUTH_REALM={auth_seed}\n" \
|
f"AUTH_REALM={auth_seed}\n" \
|
||||||
f"REALM_ALLOWED={list(realm_allowed)}\n" \
|
f"REALM_ALLOWED={list(realm_allowed)}\n" \
|
||||||
f"OTP_SERVER={otp_server}\n"
|
f"OTP_SERVER={otp_server}\n"
|
||||||
|
|
||||||
# FileOperation depends on success of previos operation i.e GitOperation.clone
|
# FileOperation depends on success of previos operation i.e GitOperation.clone
|
||||||
op.add(FileOperation.write,
|
op.add(FileOperation.write,
|
||||||
path=os.path.join("ucloud-api", ".env"),
|
path=os.path.join("ucloud-api", ".env"),
|
||||||
content=content)
|
content=content)
|
||||||
|
|
||||||
op.add(GitOperation.clone, path="ucloud-api",
|
op.add(GitOperation.clone, path="ucloud-api",
|
||||||
url="https://code.ungleich.ch/ungleich-public/ucloud_common")
|
url="https://code.ungleich.ch/ungleich-public/ucloud_common")
|
||||||
|
|
||||||
op.add(GitOperation.clone, path="ucloud-api",
|
op.add(GitOperation.clone, path="ucloud-api",
|
||||||
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper")
|
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper")
|
||||||
|
|
||||||
op.add(PipenvOperation.install, path="ucloud-api")
|
op.add(PipenvOperation.install, path="ucloud-api")
|
||||||
|
|
|
@ -96,6 +96,7 @@ def get_distro_name():
|
||||||
start = content.find("ID=") + 3
|
start = content.find("ID=") + 3
|
||||||
end = content.find("\n", start)
|
end = content.find("\n", start)
|
||||||
distro_name = content[start:end]
|
distro_name = content[start:end]
|
||||||
|
print(distro_name)
|
||||||
return distro_name
|
return distro_name
|
||||||
|
|
||||||
class PackageManagementOperation(object):
|
class PackageManagementOperation(object):
|
||||||
|
|
Loading…
Reference in a new issue