在詹金斯外殼,我想補充的遠程回購,但回購是否存在名字,然後我遇到了如何在jenkins shell中重複添加git remote repos name?
fatal: remote I-WANT-TO-PUSH already exists.
和詹金斯意外中止。
我想下面的僞代碼。
if [ ! git remote I-WANT-TO-PUSH exist? ]
git remote add I-WANT-TO-PUSH http://i-want-to-push.example.com
fi
git push I-WANT-TO-PUSH
如何做到這一點?
編輯:(感謝@Nikolay)
下面幾乎是實際代碼:
o=$(git remote | grep 'pushable')
if [[ $o == '' ]]; then
hub remote add pushable https://[email protected]/foo/bar.git
fi
後來我:起源
++ grep pushable
++ git remote
+ o=
Build step 'Execute shell' marked build as failure