Comments
4 comments
-
I’ve seen a similar issue before where it’s not calculating changes correctly. Try this as a fix.
In Jenkins go to the job and go to job configuration.
Once there find the Source Code Management under additional behaviors add a Calculate Changelog against a specific branch.
Then enter the names of the repos and branch.
This forces the comparison. -
Thanks, but that did not seem to help. I added the Additional Behaviour with my repos name and "origin/test" as the branch, but the GitHub Hook Log still reports "No changes". Is there some way to avoid this check (for No changes) altogether? If Git does a push, I want Jenkins to do a build.
-
I'm starting to think this is not possible with a single Jenkins project. I found a few posts about this but no good solutions:
https://stackoverflow.com/questions/19283187/jenkins-does-not-build-branch-after-merging-with-another-one
https://stackoverflow.com/questions/41660240/jenkins-wont-trigger-build-after-merging-a-pull-request-in-github
The only thing I can think of is create four Jenkins projects for each database; one to build the feature branches, and one each for Test/Staging/Production. This is not ideal because I have about 25 databases to deal with, but it would largely be a one-time setup.
I don't quite understand the Jenkins multi-branch pipelines but that might a more compact way to this. -
This was solved using Jenkins multi-branch pipelines. Any Git branch will build now when a push or merge is done, and I only need one Jenkins project for each database.
Add comment
Please sign in to leave a comment.
I'm working on a DevOps solution that includes SQL Change Automation, Git, and Jenkins, but I can’t seem to get Git to reliably trigger a Jenkins build when doing a Git merge.
In Git, I have three “environment” branches (test, staging, master) plus a “feature” branch named feature1.
If I commit a change to feature1, a build is triggered.
If I then merge feature1 into another branch (e.g. test), GitHub does a push to Jenkins (I can see this in the GitHub Hook Log), but no build is triggered because Jenkins (or Git, not sure which) doesn’t think there were any changes: