[ce, ee] increase webhook flexibility
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
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.
#2 Updated by Francois Dionne almost 3 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)
#5 Updated by Redmine Integration almost 3 years ago
- Status changed from In Progress to Resolved
Commit 87d3b112c6f2 by Marcin Kuzminski email@example.com on default branch changed this issue. https://internal-code.rhodecode.com/rhodecode-enterprise-ce/changeset/87d3b112c6f265e4d09b5273f9ffbf3df2333d35
#6 Updated by Redmine Integration almost 3 years ago
pullrequest merged by marcink (status: approved). https://internal-code.rhodecode.com/rhodecode-enterprise-ce/pull-request/2765