I have configured jenkins with gerrit trigger plugin to validate every commit we review to gerrit. I am expecting this trigger to include my latest change with original repo and make a build. But, it is cloning only repo project and compiling without my change. Below is my configuration settings for gerrit trigger in jenkins.
Refspec: $GERRIT_REFSPEC
Branches to build: $GERRIT_BRANCH
Build trigger: Gerrit event
Trigger on: patch set created
Gerrit project: added project and branch
Refspec: $GERRIT_REFSPEC point to refs/changes/XX/XXXXX/X
If you want get code from gerrit,you should execute this cmd in your Build step:
git fetch $GIT_URL $GERRIT_REFSPEC && git checkout FETCH_HEAD
OR you can try this:
https://wiki.jenkins.io/display/JENKINS/Gerrit+Trigger
To get the Git Plugin to download your change;
If this does not work for you
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