I am trying to build my project from a specific commit, in Jenkins.
I have specified the branch to build and it's building from the HEAD commit.
However I want to build from any specific revision/commit.
I tried passing a GIT_COMMIT
value as a parameter but it's picking up the HEAD commit only.
I also tried using svn type thing like https://svn-url@$REVISION
where REVISION is parameter passed in build.
For git it doesn't recognize ssh://git-url@REVISION
.
Then Run "Build now"
Well I think instead of hacking the build config to point to a specific commit hash, it would be better to just create a new branch, that points to the commit you want to build. If you have a correctly configured Multibranch Pipeline Build, Jenkins should discover and build your commit/branch automatically.
Alternatively you could also use a tag instead of a branch. But in this case you need to add the "Discover tags" Behaviour to your Branch Source Config.
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