I am new to Jenkins. The idea is to have a git tag on the master branch. Only by having a tag will we have the no_commits_since_last_tag number to set in the build number. The trick is to execute the git describe command from Jenkins in order to determine the tag number and the no commits number.
How could i execute git describe from Jenkins?
I am not shore if i can run this command. If i add a groovy script or a shell script (after build).
Following GIT plugins are installed:
Git plugin Git client plugin
a shell script 'after build' would suffice, a quick and dirty example:
last_tag=$(git describe)
echo $last_tag
you can the use the variable in any following logic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With