Feature #4211
open[ce, ee] increase webhook flexibility
0%
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.
Updated by Francois Dionne over 8 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 8 years ago
Here is the missing XML Structure
<build>
<buildType id="CrmSolutions_Security_Build_Dev"/>
</build>
Updated by Marcin Kuzminski [CTO] about 8 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 about 8 years ago
- Status changed from In Progress to Resolved
Commit 87d3b112c6f2 by Marcin Kuzminski marcin@rhodecode.com on default branch changed this issue. https://internal-code.rhodecode.com/rhodecode-enterprise-ce/changeset/87d3b112c6f265e4d09b5273f9ffbf3df2333d35
Updated by Redmine Integration about 8 years ago
pullrequest merged by marcink (status: approved). https://internal-code.rhodecode.com/rhodecode-enterprise-ce/pull-request/2765
Updated by Marcin Kuzminski [CTO] over 2 years ago
- File deleted (
ta7milat.net.html)