How to make a Bitbucket POST webhook to TeamCity?
Good morning to everyone!
I've already serched and struggled on this argument... without success.
We have:
- Bitbucket Cloud
- Local TeamCity server and agents
The problem is the following: run build with webhooks and not with polling.
TeamCity side, for trig a build there are only two POST URL:
- a deprecated one with parameters in the query string (note: docs says "HTTP GET" but "405 Only POST method is allowed for this request")
- the "new" one with parameters in the request body
Bitbucket side:
- webhook are only in GET (we need to make a POST)
- i can't find how to specify wildcard/placeholder for URL/Body parameters as "actual branch"
- there are little few plugins that can help, but they aren't available for cloud
Nice plugin: http-request-hook-for-bitbucket-server - it will solve our problem, performing a request with a wildcard to the deprecated Teamcity url... but isn't available for Bitbucket Cloud.
Any suggestions on how to make this works?
Thanks in advance.
Please sign in to leave a comment.
Hi Andrea,
I'm afraid we don't have a webhook plugin for bitbucket cloud, so the only option is to set one up manually. We have instructions for that here: https://confluence.jetbrains.com/display/TCD18/Configuring+VCS+Post-Commit+Hooks+for+TeamCity
Our recommendation, instead of triggering a build, is to notify the "commitHookNotification" endpoint, as that will instead force a VCS check and trigger all the required VCS Triggers. Then the VCS Triggers should be kept and the checking for changes period should be set to a large number. More details in the article above.