Triggering a Bamboo build from Bitbucket Cloud using Webhooks

Webhooks provide a way to configure Bitbucket Cloud to make requests to your server (or another external service) whenever certain events occur in Bitbucket Cloud. The purpose of this guide is to help you set up a Webhook that will trigger a Bamboo build from Bitbucket Cloud after a certain event. For example, you may want Bitbucket Cloud to trigger a Bamboo build when your repository receives a commit (aka post-commit trigger).

手順

  1. First configure the Bamboo plan to trigger with a Remote trigger: BambooPlan Configuration > Triggers > Add trigger > Remote trigger.
  2. Bamboo requires you to whitelist the IP addresses of the source of the request to trigger under the Trigger IP Addresses field (comma separated for each IP).
    1. The current list of Bitbucket Cloud IP addresses for outbound POST requests by Webhooks: Bitbucket Cloud IP Addresses
    2. CIDR Notation is only supported in Bamboo 5.14+
    3. Bamboo's IP whitelist also inspects the X-Forwarded-For HTTP header to determine the origin of the request. If you have a reverse proxy forwarding requests to your Bamboo instance, depending on it's configuration, you may also need to whitelist the IP address of the Proxy Server.
  3. Add a Webhook to your Bitbucket Cloud repository: Bitbucket Cloud > Repository > Settings > Webhooks > Add Webhook
    1. Title: Choose any title for your Webhook that aptly describes it.
    2. URL: Enter the URL of the Bamboo API to trigger a plan:  BAMBOO_URL/rest/triggers/1.0/remote/changeDetection?planKey=PLAN-KEY&skipBranches=false
      1. Replace  BAMBOO_URL with the URL of your Bamboo instance.
      2. Replace PLAN-KEY  with the key of the plan you wish to trigger. The PLAN-KEY  is visible in the URL when browsing the plan in Bamboo. E.g. https://bamboo.atlassian.com/browse/PLAN-KEY
    3. Triggers: Choose the event(s) you want the Webhook to activate on. E.g. Repository Push.
    4. Save.

That's it! If you find your Webhook doesn't appear to be working – the best place to start troubleshooting is by viewing the request and response at Bitbucket Cloud > Repository > Settings > Webhooks > View requests.

最終更新日 2017 年 9 月 28 日

この翻訳に満足しましたか?

はい
いいえ
この記事についてのフィードバックを送信する

お探しの情報が見つかりませんか?

コミュニティへの質問

Powered by Confluence and Scroll Viewport.