Skip to content
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

builds when changes made to PR and a list of branches #154

Closed
mengqing opened this issue Jul 27, 2015 · 10 comments
Closed

builds when changes made to PR and a list of branches #154

mengqing opened this issue Jul 27, 2015 · 10 comments

Comments

@mengqing
Copy link

What configuration would I need in order for changes to PR and a list of branches to trigger builds?

Currently I've got +refs/heads/:refs/remotes/origin/ +refs/pull/:refs/remotes/origin/pr/ in the Refspec and ${sha1} in the Branches to build.

It builds when changes to PR are made, however builds not triggered when changes to eg master branch are made

@KostyaSha
Copy link
Member

It's git plugin and jenkins design, or probably ghprb. You can't use PR job for regular builds.

@mengqing
Copy link
Author

So I can't have both ghprb and github-plugin running together?

@KostyaSha
Copy link
Member

Atm, yes

@DavidTanner
Copy link
Contributor

You would need to add another trigger to the job. The ghprb trigger is only going to run on plugins, then the source poll trigger could run on changes to your branches.

@mengqing
Copy link
Author

@DavidTanner At the moment, I've got GitHub Pull Request Builder and Build when a change is pushed to GitHub triggers enabled, would this be sufficient?

If not, what other triggers can I use to do what I want to do?

@arcivanov
Copy link
Contributor

Simply generate multiple jobs with different trigger versions automatically using jenkinsci/job-dsl-plugin. Create a job template and only change triggers, branch designators and publishers. You also want to make sure not to publish artifacts in PR jobs vs artifacts from stable branches.

@benpatterson
Copy link
Member

As @arcivanov mentioned, this plugin is designed for pull requests, and what you're asking for--while totally reasonable--is simply out of scope. I'm going to close this for now.

@guruvamsichintala
Copy link

With git webhook configured , How do I build a job for specific branch when someone made a push to it. I have enabled trigger when pushed code to github. Right now all jenkins jobs are triggered even though it was pushed for a different branch.

@benpatterson
Copy link
Member

@guruvamsichintala you should be able to whitelist branches on the job configuration. However, if you have multiple jobs, you'd need to set that configuration in each job. HTH

@guruvamsichintala
Copy link

I have already specified branch name in "Branches to be build" option. But still when I push code to any branch , all the jobs which are configured for specific branch and triggered when something pushed to git are running. I figured it out with

http://stackoverflow.com/questions/5784329/how-can-i-make-jenkins-ci-with-git-trigger-on-pushes-to-master/9921495#9921495

Configured git plugin inside git, specified the url inside plugin and configured job with poll scm (no schedule). Worked perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants