Configuring Git Repository to trigger the build in a Windows environment

お困りですか?

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

コミュニティに質問

This article is a guideline to configure a Git repository to trigger a Bamboo build in Windows.  The steps are mainly covered in: Repository triggers the build when changes are committed, but due to different default settings and commands in a Windows environment, there are some differences.  The overall process is: a commit to the repository causes a post-commit message to be sent to Bamboo. Bamboo then responds by checking the repository for un-built changes. If changes are found, Bamboo triggers a build.

Configuring the repository to trigger the build when changes are committed requires two steps:

Configuring your source repository

  1. Copy the scripts to your repository. If you are using the Bamboo distribution, the scripts are located in the /scripts folder of your Bamboo Installation Directory. If you are using Bamboo EAR-WAR distribution, you can find them in the /repositoryScripts folder. You can also download the scripts by following this FIZME link.
  2.  Edit the Git respository's .git/hooks/post-commit trigger file with something like: /pathto/postCommitBuildTrigger.py http://bambooserver MYTESTPROJECT-MYTESTPLAN. In "MYTESTPROJECT-MYTESTPLAN", MYTESTPROJECT is the project name in Bamboo and MYTESTPLAN is the plan name. Make sure that Python 2.X is installed. Also, since the hook will look for python under the default path "/usr/bin/python" add the path to the python executable in the beginning. Also, use use double quotation marks for local paths. 

    Example: 
    In this example "C:\Users\ssetayeshfar\hello" is the path to my local git repository. The "postCommitBuildTrigger.py" from under svn-triggers should be used. 

    "C:\Python27\python.exe" "C:\Users\ssetayeshfar\hello\svn-triggers\postCommitBuildTrigger.py" http://localhost:8085 MYTESTPROJECT-MYTESTPLAN

  3. Bamboo を実行しているユーザーが、スクリプトを実行する適切なファイル権限を持っていることを確認します。つまり、スクリプトは非 root ユーザーでも実行可能でなければなりません。

Configuring Bamboo to respond to post-commit messages

始める前に

  • Triggering a build when there is no repository update — Bamboo will ignore build triggering requests if there are no changes committed to the repository branch, which is configured for the particular Bamboo plan.

To configure Bamboo to trigger a build:

  1. Click Dashboard and then the All Plans tab.
  2. リスト内で計画を見つけ、編集アイコンをクリックして、計画の設定ページを表示します。
  3. Click the Triggers tab, then click either an existing trigger or Add Trigger.
  4. オプションで、トリガーの説明を入力します。
  5. Choose Trigger type > Repository triggers the build when changes are committed.
  6. Bamboo displays the available repositories for the plan, as previously configured on the Source Repositories tab. Choose the repositories that this trigger should apply to.
  7. Only enter an IP address in Trigger IP Addresses if you want Bamboo to trigger on post-commit messages from other than the primary IP address for the repository.

最終更新日 2018 年 11 月 8 日

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

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