ucloud-setup/app/image.py
2019-08-28 16:42:50 +05:00

39 lines
701 B
Python

import click
import subprocess
import os
from app.helper import (
clone,
clone_common,
clone_etcd_wrapper,
GitOperation,
PipenvOperation,
FileOperation,
)
@click.group()
def image():
pass
@image.command("setup")
@click.option("--path", required=True)
def setup(path):
os.chdir(path)
repo_name = "ucloud-image-scanner"
op_result = GitOperation.clone(
f"https://code.ungleich.ch/ungleich-public/{repo_name}.git"
)
op_result.add(
GitOperation.clone,
path=repo_name,
url="https://code.ungleich.ch/ahmedbilal/etcd3_wrapper",
)
op_result.add(PipenvOperation.install, path=repo_name)
# Write Crontab entry