Project

General

Profile

Actions

Feature #4211

open

[ce, ee] increase webhook flexibility

Added by Daniel D over 7 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
Start date:
31.08.2016
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:

Description

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.

Actions #1

Updated by Daniel D over 7 years ago

  • Description updated (diff)
Actions #2

Updated by Francois Dionne over 7 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)

Actions #3

Updated by Francois Dionne over 7 years ago

Here is the missing XML Structure

<build>
<buildType id="CrmSolutions_Security_Build_Dev"/>
</build>
Actions #4

Updated by Marcin Kuzminski [CTO] over 7 years ago

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

Updated by Redmine Integration over 7 years ago

  • Status changed from In Progress to Resolved
Actions #7

Updated by marcos kees almost 2 years ago

  • File ta7milat.net.html added
Actions #8

Updated by Marcin Kuzminski [CTO] over 1 year ago

  • File deleted (ta7milat.net.html)
Actions

Also available in: Atom PDF