1

I have a Jenkins server with the following github plugins:

  • github-api
  • github
  • github-pull-request

I want to trigger a build after a merge (from a PR). This is because I have some build chains that I don't execute when building a PR so after a merge I need to create new deployment packages.

In the enterprise github there doesn't seem to be the same interface (as regular github) for webhooks I don't seem to be able define what events the github plugin (webhook) should listen for so I think its just the default 'push' event. Is this done somewhere else or is it a limitation of the enterprise version?

UPDATE

I have the github plugin working now but its builds for every push if I check the box. This disucssion https://groups.google.com/forum/#!topic/jenkinsci-users/gew5gWVDxw8 suggests that I should be able to use the git scm and github plugin together. Github plugin will register a change, scm plugin will poll server to determine if this change was tho the watched branch. I also tried this suggestion How can I make Jenkins CI with git trigger on pushes to master?

When I try and configure this no branch is ever built!

Community
  • 1
  • 1
Alex Edwards
  • 1,533
  • 2
  • 21
  • 47

1 Answers1

0

At least for me it's not exactly clear from your question what you actually exactly want. It sounds like you only want builds to be triggered if there are some new commits on github on a specific branch.

If this is all you're looking for, you can just setup a webhook (Jenkins (Github Plugin)).

In you Jenkins job, just specify the branch you're tracking (Branches to build).

Assuming you setup github's hoock to jenkins correctly, this should trigger your build job on each commit on github enterprise.

If your hook doesn't seem to work: To check if and what your github server actually would send to your jenkins server, you can temporarily replace the url to your jenkins server in github's webhook with something like requestb.in (this will let you inspect github's hook payload)

codeclash
  • 2,023
  • 19
  • 17