1
votes

I want to have a integration between my repository and Jenkins Job. The idea is that, after commit or push something into specified repository, the specified jenkins job should immediately starts build. There was similar topic click, but i don't get it. How to configure this correctly? My repository is on RhodeCode Enterprise 4.3.1 Community Edition I guess, that I need to create webhook in my repository and then configure my jenkins job. Here is what I see in my repository: enter image description here And here is, section "Build Triggers" of the jenkins job:enter image description here So, i guess that token should be the same, and the webhook url should be url to jenkins job? Am I right?

1

1 Answers

1
votes

Yes you have to select push event, and enter the url for Jenkins build. The has to be configured in Jenkins, eg build url can be: http://server/job/ourProjectName/build

Since RhodeCode 4.5.X there are templates in the build url, so you can create a catch-all webhooks, in the format of http://server/job/${repo_name}/build?

or even to submit a branch:

http://server/job/${repo_name}/buildWithParameters?token=TOKEN&BRANCH=${branch}

TOKEN is required from your Jenkins installation.

So in this way you can have different jobs for different branches

Check more here how to configure parameters on Jenkins side: https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build