gerrit代码库切分支脚本

curl –digest –user admin:lZ6wrtsCoPMGLRdFjoTkthOywkLlY8JpJuFSxxx -X DELETE http://x.x.x.x:8081/a/projects/$1/branches/$3

sleep 5

curl –digest –user admin:lZ6wrtsCoPMGLRdFjoTkthOywkLlY8JpJuFSxxx http://x.x.x.x:8081/a/projects/$1/branches/$2 > $2.txt

sed -i ‘1d’ $2.txt
sed -i ‘2d’ $2.txt
sed -i ‘3d’ $2.txt
sed -i ‘s/,//g’ $2.txt

curl –digest –user admin:lZ6wrtsCoPMGLRdFjoTkthOywkLlY8JpJuFSxxx -X PUT -d@$2.txt –header “Content-Type: application/json;charset=UTF-8” http://x.x.x.x:8081/a/projects/$1/branches/$3

以上是shell脚本,下面是jenkins中的命令:
/root/branch_manager/recreate_branch.sh Cloud%2F$ProjectName ww_daily ww_qa

发表评论

电子邮件地址不会被公开。 必填项已用*标注