This commit is contained in:
aozhiwei 2018-09-15 10:30:36 +08:00
parent 7e3405a9ac
commit a6794da933

View File

@ -18,10 +18,10 @@ for proj in projects:
http_url_to_repo = proj['http_url_to_repo']
name = proj['name']
path = proj['namespace']['path']
if not os.path.exists('repository/' + path):
os.mkdir('repository/' + path)
if not os.path.exists('repository/' + path + '/' + name):
os.system('cd repository/' + path + ' && git clone ' + http_url_to_repo)
os.system('cd repository/' + path + ' && git pull')
os.system('cd repository/' + path + ' && git submodule init')
os.system('cd repository/' + path + ' && git submodule update')
if not os.path.exists('repository/%s' % path):
os.mkdir('repository/%s' % (path))
if not os.path.exists('repository/%s/%s' % (path, name)):
os.system('cd repository/%s/%s && git clone %s' % (path, name, http_url_to_repo))
os.system('cd repository/%s/%s && git pull' % (path, name))
os.system('cd repository/%s/%s && git submodule init' % (path, name))
os.system('cd repository/%s/%s && git submodule update' % (path, name))