-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using git webhook, jenkins run build when code pushed to specific Branch #178
Comments
I am having the same issue. Any solutions? |
On github, instead of jenkins-github plugin , used jenkins-git plugin with url " http://yourserver/jenkins/git/notifyCommit?url= ". Then in the jenkins jobs changed the build trigger to Poll SCM , but do not specify a schedule instead of Build when a change is pushed to GitHub. Follow the link: |
@guruvamsichintala how does it trigger build only on a specific branch? |
As you configured the "notifycommit url" and jenkins jobs to poll, Git notifies jenkins when code is pushed. Then it checks all the jobs with poll and checks if any job is configured with changed branch and triggers it. |
@guruvamsichintala we are not using this plugin on Github. It's on stash server(aka bit bucket server). |
What do your jenkins jobs configurations look like? I have the same setup (we actually have 1 job per branch). If someone modifies master (by a commit) it doesn't trigger the jobs using a different branch. |
earlier we configured "build when pushed to git repository" in build triggers which didn't work. All the jobs used to trigger build even though a code is pushed to single branch. |
Ran into issues with this and it seemed like the only way around it was to use a fork workflow instead of a clone workflow. hoping to revisit this. |
@raptordzuricsko Does #172 fix your problem? I'm currently testing it for a merge. |
I believe it does. you are a hero alexBraidwood ! |
I have scenario where I have two branches B1 and B2. I have configured two jobs in Jenkins which builds those branches when something is pushed to github. Right now even though some one pushed code into B1, jenkins runs both the jobs as webhook triggered jenkins with code push. Is there a way I can run jenkins job using git webhook where B1 job must run only when git receives push for B1
The text was updated successfully, but these errors were encountered: