How can I set the version of a Jenkins build based on a Git tag?
What I am currently doing:
What I would like to do: Instead of using the Jenkins BUILD_NUMBER, I would like to extract the last build number from the Git tag and increment it
What is the best way to achieve this?
Git doesn't really know about Maven. Is there any specific reason why Git should drive the numbering?
Maven is IMHO the better choice. It knows about your source control (if you have configured <scm>
correctly) and knows what the version is and if it's a release or a snapshot.
With the combination of Maven + Git + Jenkins we are very happy with the Release plugin : It takes your snapshot, does a Maven release and tags it in Git, and commits the change to the next snapshot (you define that version number).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.