a
This commit is contained in:
commit
d51f7fcbfd
7 changed files with 153 additions and 0 deletions
36
app/helper.py
Normal file
36
app/helper.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import subprocess
|
||||
|
||||
|
||||
def clone(repo):
|
||||
command = f"git clone {repo}"
|
||||
try:
|
||||
subprocess.check_output(command.split())
|
||||
except subprocess.CalledProcessError as e:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def clone_common():
|
||||
return clone("https://code.ungleich.ch/ungleich-public/ucloud_common")
|
||||
|
||||
def clone_etcd_wrapper():
|
||||
return clone("https://code.ungleich.ch/ahmedbilal/etcd3_wrapper")
|
||||
|
||||
|
||||
class Operation(object):
|
||||
def __init__(self):
|
||||
self.result = []
|
||||
|
||||
def execute(self, rc):
|
||||
self.result.append(rc)
|
||||
|
||||
|
||||
def pipenv_install(_dir):
|
||||
command = f"pipenv install"
|
||||
try:
|
||||
subprocess.check_output(command.split(), cwd=_dir)
|
||||
except subprocess.CalledProcessError as e:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue