首页 > 解决方案 > 发布后 Jenkins 的 Git Tag

问题描述

我正在为一个项目使用 Jenkins、GitLab、Maven 和 Nexus。以前我使用 Jenkins shell 命令进行 mvn build 和 nexus release 工件上传。现在我必须为它创建 Git Tag。有人可以提供这样做的指导。我使用shell命令的所有东西。我可以使用这些命令吗?

git tag -a v0.0.1 -m "0.0.1 tag"
git push origin v0.0.1  

标签: gitmavenjenkinsgitlabnexus

解决方案


这些命令对我有用。

#!/bin/bash
echo tagging with build-$BUILD_NUMBER
git tag -f build-$BUILD_NUMBER
git tag -l 
git remote -v
git remote set-url origin https://$USERNAME:$PASSWORD@hub.jazz.net/git/user/project
git push --tags origin 

关注https://developer.ibm.com/answers/questions/187229/is-there-a-way-to-tag-a-commit-in-git-inside-of-a/


推荐阅读