diff --git a/gitlab/githelper.py b/gitlab/githelper.py index ded8189..481ebd1 100644 --- a/gitlab/githelper.py +++ b/gitlab/githelper.py @@ -18,7 +18,7 @@ for proj in projects: http_url_to_repo = proj['http_url_to_repo'] name = proj['name'] path = proj['namespace']['path'] - if name != 'game1008': + if path != 'publish' or not ('game1008' in name): continue if not os.path.exists('repository/%s' % path): os.mkdir('repository/%s' % (path)) @@ -27,4 +27,9 @@ for proj in projects: 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)) - #print('%s/%s' % (path, name)) + submodules = os.listdir('repository/%s/%s/third_party' % (path, name)) + for module_name in submodules: + os.system('cd repository/%s/%s/third_party/%s && git checkout master && git pull' % + (path, name, module_name)) + os.system('cd repository/%s/%s && git commit -am "同步代码" && git push' % (path, name)) + print('%s/%s' % (path, name))