How to trigger Bamboo builds with GitHub webhook

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

Repository Polling is added by default when configuring a GitHub repository in Bamboo and its design is to frequently detect changes in the source code, periodically or based on a schedule which may not be the best strategy for all build plans, since they tend to overload the server with scheduled tasks to check the remote repository and this can reduce the server performance.

The steps from this article are intended to allow you to use a different configuration that will remove the cost of frequent remote repository checks.

環境

All supported versions of Bamboo.

ソリューション

Configuration steps

  1. The Bamboo instance needs to be reachable through the internet. Otherwise, GitHub will not be able to find it to trigger a build.
  2. If you already have a polling trigger configured, remove it. Go to Plan configuration >> Triggers and remove the polling trigger.
  3. Add the Remote Trigger to the plan you want GitHub to trigger.
  4. Enter the list of addresses (CIDR Notation compatible) that can trigger builds in Bamboo.
    1. The list of GitHub IP addresses for outbound POST requests by Webhooks can be retrieved from GitHub's meta API endpoint.
    2. Bamboo's IP allowlist also inspects the X-Forwarded-For HTTP header to determine the origin of the request. If you have a reverse proxy / load balancer forwarding requests to your Bamboo instance, depending on its configuration, you may also need to add to the allowlist the IP address of the proxy / load balancer server.
  5. Make sure the anonymous users can trigger builds. Go to Overview >> Security >> Security settings >> Check the option '[x] Allow anonymous users to trigger remote repository change detection and Bamboo Specs detection'
  6. Configure GitHub to call the following Bamboo REST API:

    https://<BAMBOO_URL>/rest/triggers/latest/remote/changeDetection?planKey=<PLAN-KEY>

    The above steps should be enough to configure the Bamboo instance for remote triggers from GitHub.

  7. Make sure that the Content-type field is set to application/json

(info) The "skipBranches" can be appended to the endpoint URL to determine whether change detection will be triggered by this event for every branch on the plan (false), or just the plan key specified (true).

i.e.:

https://<BAMBOO_URL>/rest/triggers/latest/remote/changeDetection?planKey=<PLAN-KEY>&skipBranches=false

For more details about remote triggers please visit the official documentation.

最終更新日 2023 年 11 月 7 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.