This commit is contained in:
chendelin1982 2021-09-26 23:05:59 +08:00
parent 2c04627f8d
commit 65500eb06e
3 changed files with 21 additions and 6 deletions

View file

@ -1,8 +1,11 @@
import model import model, os
path_repo = "./data/application.list" path_repo = "./data/application.list"
path_project = "" path_project = ""
# for Git clone HA
github_url = ("https://github.com", "https://github.com.cnpmjs.org", "https://hub.fastgit.org")
class Print: class Print:
def __init__(self): def __init__(self):
@ -10,3 +13,14 @@ class Print:
def printRepo(): def printRepo():
model.FileOp.printJson(path_repo) model.FileOp.printJson(path_repo)
class Github:
def __init__(self):
pass
def gitClone(name: str):
cmd = "git clone --depth=1 " + model.SmoothUrl.res(github_url) + "/websoft9/docker-" + name + " repo/docker-"+name
print(cmd)
os.system(cmd)

View file

@ -5,9 +5,6 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, U
import urllib.parse import urllib.parse
import urllib.request import urllib.request
# for Git clone HA
github_url = ("https://github.com", "https://github.com.cnpmjs.org", "https://hub.fastgit.org")
class SmoothUrl: class SmoothUrl:
''' get url ''' ''' get url '''

View file

@ -13,6 +13,10 @@ def list():
'''print the lists file''' '''print the lists file'''
controller.Print.printRepo() controller.Print.printRepo()
@app.command()
def gitclone(name: str):
'''git clone'''
controller.Github.gitClone(name)
@app.command() @app.command()
def update(name: str): def update(name: str):