jenkins pipeline : 使用sh脚本自动打git tag

发布时间 2023-06-21 16:07:12作者: 大哥超帅
if [[ "${GIT_BRANCH}" == "xxx" ]]; then
    TAG_VERSION="V"$(mvn -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec -q | sed 's/-SNAPSHOT//')

#如果没拉到分支先fetch 一下
# git fetch
git checkout

git tag  "${TAG_VERSION}"

git push origin "${TAG_VERSION}"

fi