From 6cb7b1bacf9f6734aa865a972fcaf0bfb5be27a4 Mon Sep 17 00:00:00 2001 From: Ahmed Bilal Khalid Date: Wed, 28 Aug 2019 20:42:57 +0500 Subject: [PATCH] a --- app/api.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/api.py b/app/api.py index 174b1e6..270c242 100644 --- a/app/api.py +++ b/app/api.py @@ -1,6 +1,7 @@ import click import subprocess import os +import shutil from app.helper import ( clone, @@ -35,9 +36,11 @@ def setup(path, auth_name, auth_seed, auth_realm, realm_allowed, otp_server, etcd_url, 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")