代码拉取完成,页面将自动刷新
#!/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
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")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。