a
This commit is contained in:
parent
87f7767af5
commit
bd43624689
5 changed files with 19 additions and 3 deletions
|
@ -70,5 +70,5 @@ def setup(path, auth_name, auth_seed, auth_realm,
|
|||
)
|
||||
shutil.copytree(src=os.path.join(repo_name, "etcd3_wrapper"),
|
||||
dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper"))
|
||||
|
||||
op.add(PipenvOperation.create, path=repo_name, site_packages=True)
|
||||
op.add(PipenvOperation.install, path=repo_name)
|
||||
|
|
|
@ -47,6 +47,7 @@ def setup(path, base_dir, file_prefix, etcd_url, etcd_password):
|
|||
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
|
||||
)
|
||||
|
||||
op_result.add(PipenvOperation.create, path=repo_name, site_packages=True)
|
||||
op_result.add(PipenvOperation.install, path=repo_name)
|
||||
|
||||
# Write Crontab entry
|
||||
|
|
|
@ -67,6 +67,19 @@ class GitOperation(object):
|
|||
|
||||
|
||||
class PipenvOperation(object):
|
||||
@staticmethod
|
||||
def create(path=".", site_packages=False):
|
||||
if site_packages:
|
||||
command = f"pipenv --site-packages --python 3.7"
|
||||
else:
|
||||
command = "pipenv --python 3.7"
|
||||
try:
|
||||
output = subprocess.check_output(command.split(), cwd=path)
|
||||
except subprocess.CalledProcessError as e:
|
||||
return Result(e, ResultType.failure, inspect.currentframe().f_code.co_name)
|
||||
else:
|
||||
return Result(output, ResultType.success)
|
||||
|
||||
@staticmethod
|
||||
def install(path=".", package_name=None):
|
||||
if package_name:
|
||||
|
|
|
@ -60,5 +60,6 @@ def setup(path, ssh_username, ssh_key_path, ssh_key_pass, etcd_url, etcd_passwor
|
|||
|
||||
shutil.copytree(src=os.path.join(repo_name, "etcd3_wrapper"),
|
||||
dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper"))
|
||||
|
||||
|
||||
op_result.add(PipenvOperation.create, path=repo_name, site_packages=True)
|
||||
op_result.add(PipenvOperation.install, path=repo_name)
|
||||
|
|
|
@ -45,7 +45,8 @@ def setup(path, base_dir, etcd_url, etcd_password):
|
|||
path=repo_name,
|
||||
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
|
||||
)
|
||||
|
||||
|
||||
op_result.add(PipenvOperation.create, path=repo_name, site_packages=True)
|
||||
op_result.add(PipenvOperation.install, path=repo_name)
|
||||
|
||||
# Write Crontab entry
|
||||
|
|
Loading…
Reference in a new issue