a
This commit is contained in:
parent
8d79194b29
commit
f784e50dd9
2 changed files with 10 additions and 6 deletions
|
@ -35,5 +35,5 @@ rc-update add etcd
|
||||||
|
|
||||||
|
|
||||||
etcdctl --endpoints http://$1:2379 user add root:$2
|
etcdctl --endpoints http://$1:2379 user add root:$2
|
||||||
etcdctl --endpoints http://$1:2379 user grant root --roles root
|
etcdctl --endpoints http://$1:2379 user grant-role root root
|
||||||
etcdctl --endpoints http://$1:2379 auth enable
|
etcdctl --endpoints http://$1:2379 auth enable
|
||||||
|
|
|
@ -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 scheduler():
|
||||||
@click.option("--vm_prefix", required=True)
|
@click.option("--vm_prefix", required=True)
|
||||||
@click.option("--host_prefix", required=True)
|
@click.option("--host_prefix", required=True)
|
||||||
@click.option("--request_prefix", required=True)
|
@click.option("--request_prefix", 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, vm_prefix, host_prefix, request_prefix, etcd_host, etcd_port):
|
def setup(path, vm_prefix, host_prefix, request_prefix, etcd_url, etcd_password):
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
repo_name = "ucloud-scheduler"
|
repo_name = "ucloud-scheduler"
|
||||||
|
@ -37,8 +38,8 @@ def setup(path, vm_prefix, host_prefix, request_prefix, etcd_host, etcd_port):
|
||||||
f"VM_PREFIX={vm_prefix}\n"
|
f"VM_PREFIX={vm_prefix}\n"
|
||||||
f"HOST_PREFIX={host_prefix}\n"
|
f"HOST_PREFIX={host_prefix}\n"
|
||||||
f"REQUEST_PREFIX={request_prefix}\n"
|
f"REQUEST_PREFIX={request_prefix}\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, vm_prefix, host_prefix, request_prefix, 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)
|
||||||
|
|
Loading…
Reference in a new issue