We use gerrit-trigger in Jenkins, the build is triggered when a new changeset is pushed for review.
Now we want to introduce pipeline and use solution Defining a pipeline in scm
Therefore we expect when the build is triggered, below pipeline plugin can work to checkout this refspec
But the ${GERRIT_REFSPEC}
doesn't effect here, it checkouts the master still
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision adf5d360582b1b24f088cfa8ac0f0ebf64a57692 (refs/remotes/origin/master) Commit message: "DO:CI End of summer" > git config core.sparsecheckout # timeout=10 > git checkout -f adf5d360582b1b24f088cfa8ac0f0ebf64a57692
Any suggestion how it can work?
I think you need to set:
Repositories > Refspec = $GERRIT_REFSPEC:$GERRIT_REFSPEC
Branches to build > Branch Specifier = $GERRIT_REFSPEC
Important: do not forget to uncheck the "Lightweight checkout" option.
Or you can use in Jenkins job.
Refspec: ${GERRIT_REFSPEC}
Branch Specifier: FETCH_HEAD.
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