I have a jenkins CI setup where development work is done in feature branches and when a pull request is made against the master
branch, Jenkins runs a build against that pull request to confirm that all tests are passing. This is then synced back to our repo so that the person reviewing the pull request knows that the tests aren't goofed.
I would like to update this setup so that before Jenkins builds the branch from the pull request, it merges master
into the pull request branch and builds the result. This merge should not be pushed back because it is still pending review, but this will ensure that tests are running against what the actual post-pull-request result will be.
I have found info on and tried the Merge before build
action but this appears to merge the pull request branch into master
, then if that succeeds, check the pull request branch back out and build. This is great for catching future merge conficts, but still does not catch the pull request branch up to master
before building.
In the documentation for the Git Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin) it mentions a feature that appears to do exactly what I want: "Next, pick a particular branch name as the integration target in the 'Advanced' section - (e.g. 'master', or 'stable'), and select 'Merge before build'", but this option is not available to me in Jenkins. I have the latest plugin so I am not sure if they removed this and didn't update their docs or what.
Does anyone know how to achieve the "merge another branch into my current branch and build the result" action?
Thanks!