0
votes

I have a jenkins site job that builds after a successful build of the release job. The build is deployed to a maven site and displays the version of the build, however it is deploying a SNAPSHOT version.

Is there any way I can pass the git tag that is added at release into the site job so that rather than checking out the release branch (which has moved on to the snapshot) it checks out the tagged release commit and builds off of that?

The maven goals I am using in the site job are -V clean site-deploy

Any ideas would be greatly appreciated!

1

1 Answers

0
votes

One easy way is to specify the tag name in your specific job Jenkins Configuration where the git branch name is specified. So if your git branch name is default, Jenkins checks out to the latest default branch code. But if you specify the tag name here, Jenkins will check out to this tag version. To avoid hard coding it, use the Parameterized trigger plugin and add a parameter called revision. Then in the git branch location use ${revision}. When the user triggers the build, they can specify at what revision the code should be updated to using this parameter.