使用这个shell 的时候 如果是在 jenkins 调用这个shell ,存放 shell的这个服务器必须要和gitlab 做认证 做免密
#!/bin/bash
Develop=feature_20220331_v4.0
Test=release_test_20220331_4.0
#Develop=ceshi
#Test=ceshi2
cd /root/123
if [ -d back-end-code ];then
rm -rf back-end-code
git clone -b $Develop git@192.168.1.161:accountanagement/back-end-code.git
else
git clone -b $Develop git@192.168.1.161:accountanagement/back-end-code.git
fi
#git init .
#git add .
#git commit -m "合并分支"
#git branch ceishi2
#git branch -a
#git checkout ceishi2
#git merge --no-ff ceshi
#git push origin ceishi2
cd /root/123/back-end-code
git checkout $Test
git merge --no-ff $Develop -m "feature into release"
git push origin $Test