为了解决每次迭代上线后,批量打tag、批量切新迭代分支、批量回归,等需要人工一个一个的操作的难题,开发此工具
pip install --user --index-url https://mirrors.aliyun.com/pypi/simple/ requests
// requests
pip install idna-2.10-py3-none-any.whl
pip install urllib3-1.26.9-py2.py3-none-any.whl
pip install chardet-4.0.0-py3-none-any.whl
pip install certifi-2019.11.28-py2.py3-none-any.whl
进入到 requests-master.zip文件中,执行 python setup.py install
你的git要加入环境变量,并且配置好ssh免密登录
JAVA_HOME要加入环境变量,因为maven使用的这个变量
{
"git-url": "https://gitlab.com/",
"token": "***", // 你得token
"project-ids": { // 批量创建分支、mr、tag等操作
"test1": 4, // credit项目名称,4为项目id,可配置多个
"test2": 5
},
"project-repository": [ // 自动拉代码切分支
{
"project-name": "tesst1",
"ssh-url": "git@gitlab.com:/tesst1.git"
},
{
"project-name": "tesst2",
"ssh-url": "git@gitlab.com:/tesst2.git"
}
]
}
分支名是 feature/20220421 具有斜杠的这种形式, 如果报404 请尝试 将/ 转成 %2F 如:feature%2F20220421
python git-helper.py branch opt=create new_branch=tset8 origin=master
python git-helper.py branch opt=delete branch=tset8
python git-helper.py branch opt=protect branch=tset4
python git-helper.py mr opt=create source_branch=tset4 target_branch=main title="系统测试"
python git-helper.py tag opt=create tag_name=V2.1.7.3 ref=tset4
拉代码 到当前盘符的/build-package/code下
python git-helper.py build opt=build branch=feature/20220429