Feature #4211

[ce, ee] increase webhook flexibility

Added by Daniel D over 4 years ago. Updated over 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Commit Number:


How would I go about if I wanted the webhook being able to trigger a certain branch to build in Jenkins? I'm using Pipeline/Pipeline Multibranch, but regardles, it'd require something like:

http://server/myjenkinsproject/job/< BRANCHNAME >/build

Does Rhodecode provide any environment variables through the webhook setup in the UI that I could pass in for < BRANCHNAME > or is this something I'd have to hand code as an extension?

This feature was requested in community-discussion.

From what I can tell, if we allow template variables in the url, which get interpolated with the event dict, we can get this functionality

eg. http://server/{event['branch']}/build

The problem is (in this particular use case) that there can be multiple branches per push - which complicates matters, not sure how to get around this.


Updated by Daniel D over 4 years ago

  • Description updated (diff)

Updated by Francois Dionne over 4 years ago

We use TeamCity,

At the moment, TeamCity has to poke RhodeCode repositories to know if there is something new to build. We have so much build configurations that we paused most of the triggers to minimise the amount of request RhodeCode has to manage.

I did some search and TeamCity has a REST API that we could use to start build. This is an example of the cURL request that start a build.

curl -u user:password --request POST http://yourserver:8080/app/rest/buildQueue --header "Content-Type:application/xml" --data-binary @build.xml

Where build.xml has the following structure.

According to me, if you want RhodeCode to trigger build in TeamCity, then there should be general configuration that apply to all “triggers”.
• TeamCity User
• TeamCity User Password
• TeamCity Server URL

Then in each Repository, we should be able to add as many "trigger" as we need with the following parameters to generate the “xml”.
• Branch Name
• BuildType id (Build Configuration ID)


Updated by Francois Dionne over 4 years ago

Here is the missing XML Structure

<buildType id="CrmSolutions_Security_Build_Dev"/>

Updated by Marcin Kuzminski [CTO] over 4 years ago

  • Status changed from New to In Progress
  • Assignee set to Marcin Kuzminski [CTO]
  • Target version set to v4.5

Updated by Redmine Integration over 4 years ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF