1 Star 0 Fork 0

PersonalSummary/gerrit_sync

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
闻飞 提交于 2024-12-31 08:15 . config for gerrit upload
#!/usr/bin/python3
# coding=utf-8
import xml_parse
import os
import warnings
import subprocess
import time
import shutil
# 上传源代码
def upload_code(project_name, project_path, branch, project_url):
cmd = "bash ./upload.sh {} {} {} {}".format(project_name, project_path, branch, project_url)
process = subprocess.Popen(cmd, shell=True, stdout=2, stderr=2)
process.wait()
return process.returncode
def gerrit_upload_by_code(path, branch="master"):
# 获取project_list
xmlParse = xml_parse.XmlParse(ohos_path=path)
xmlParse.parse_xml()
# 解析project_list
err_list = []
idx = 0
for plist in xmlParse.plist:
pname = plist['name']
ppath = plist['path']
print("{} project is {}, path is {}".format(idx, pname, ppath))
idx = idx + 1
purl = "ssh://[email protected]:29418/th1520-openharmony/{}.git".format(pname)
ret = upload_code(project_name=pname, project_path=ppath, branch=branch, project_url=purl)
if ret:
err_list.append(pname)
else:
print("error list:")
for lt in err_list:
print(lt)
return -3
if __name__ == '__main__':
warnings.filterwarnings('ignore')
path="/home/wen_fei/OpenHarmony/dayu800-v4.1-release_tmp"
gerrit_upload_by_code(path=path, branch="OpenHarmony-v4.1-Release")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/personal-summary/gerrit_sync.git
[email protected]:personal-summary/gerrit_sync.git
personal-summary
gerrit_sync
gerrit_sync
master

搜索帮助