This commit is contained in:
ahmadbilalkhalid 2019-08-28 22:28:56 +05:00
parent f784e50dd9
commit f4efad8ae2
2 changed files with 11 additions and 6 deletions

View file

@ -70,4 +70,5 @@ def setup(path, auth_name, auth_seed, auth_realm,
) )
shutil.copytree(src=os.path.join(repo_name, "etcd3_wrapper"), shutil.copytree(src=os.path.join(repo_name, "etcd3_wrapper"),
dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper")) dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper"))
op.add(PipenvOperation.install, path="ucloud-api")
op.add(PipenvOperation.install, path=repo_name)

View file

@ -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,
@ -22,9 +23,9 @@ def host():
@click.option("--ssh_username", required=True) @click.option("--ssh_username", required=True)
@click.option("--ssh_key_path", required=True, help="For Example, ~/.ssh/id_rsa") @click.option("--ssh_key_path", required=True, help="For Example, ~/.ssh/id_rsa")
@click.option("--ssh_key_pass", required=True) @click.option("--ssh_key_pass", required=True)
@click.option("--etcd_host", required=True) @click.option("--etcd_url", required=True)
@click.option("--etcd_port", required=True) @click.option("--etcd_password", required=True)
def setup(path, ssh_username, ssh_key_path, ssh_key_pass, etcd_host, etcd_port): def setup(path, ssh_username, ssh_key_path, ssh_key_pass, etcd_url, etcd_password):
os.chdir(path) os.chdir(path)
repo_name = "ucloud-vm" repo_name = "ucloud-vm"
@ -37,8 +38,8 @@ def setup(path, ssh_username, ssh_key_path, ssh_key_pass, etcd_host, etcd_port):
f"ssh_username={ssh_username}\n" f"ssh_username={ssh_username}\n"
f"ssh_pkey={ssh_key_path}\n" f"ssh_pkey={ssh_key_path}\n"
f"ssh_private_key_password={ssh_key_pass}\n" f"ssh_private_key_password={ssh_key_pass}\n"
f"ETCD_HOST={etcd_host}\n" f"ETCD_URL={etcd_url}\n"
f"ETCD_PORT={etcd_port}\n" f"ETCD_PASSWORD={etcd_password}\n"
) )
op_result.add( op_result.add(
@ -57,4 +58,7 @@ def setup(path, ssh_username, ssh_key_path, ssh_key_pass, etcd_host, etcd_port):
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper", url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
) )
shutil.copytree(src=os.path.join(repo_name, "etcd3_wrapper"),
dst=os.path.join(repo_name, "ucloud_common", "etcd3_wrapper"))
op_result.add(PipenvOperation.install, path=repo_name) op_result.add(PipenvOperation.install, path=repo_name)