Using the source repository to trigger the build of a plan is one of the available methods for triggering builds in Bamboo. "Repository triggers the build when changes are committed" has the advantage of placing minimal load on your Bamboo server. However, it requires that your source repository is configured to fire an event to the Bamboo server (which the configured Plan will 'listen for').Configuring the repository to trigger the build when changes are committed requires two changes:
|
1. Configuring your source repository
To configure your source repository:
Configure your source code management system's repository to send post-commit event messages to Bamboo. These messages tell Bamboo to begin building the plans that use this repository.
- 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 link. - Depending on which operating system your repository is running on, you may need to edit the scripts. The scripts assume that '
wget
' is in '/usr/bin/
'; if this isn't the case for your repository (e.g. Solaris 10 has it in/usr/sfw/bin/
), edit the scripts and change '/usr/bin/
' to the appropriate location. - Ensure that the user which Bamboo is running as has appropriate file permissions to execute the scripts, i.e. the scripts should be executable by non-root user(s).
- Enable Bamboo's remote API so that the scripts can use Bamboo's REST-style remote API to access Bamboo's data.
2. Configuring Bamboo to trigger a build on code check in
Before you begin:
- Triggering a build when there is no update — Bamboo will ignore the build triggers, if the local working copy and the repository copy have the same revision numbers. When testing your build triggers, please check that the local working copy is not the latest version - in which case, no further action will be taken.
To configure Bamboo to trigger a build on code check in:
- Click Dashboard and then the All Plans tab.
- Locate the plan in the list and click the edit icon to display the plan's configuration pages.
- Click the Triggers tab, then click either an existing trigger or Add Trigger.
- Optionally, enter a trigger description.
- Choose Trigger type > Repository triggers the build when changes are committed.
- 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.
Only enter an IP address in Trigger IP Addresses if you want Bamboo to receive post-commit notifications from other than the primary IP address for the repository.
If you use a Mercurial or Git repository then you must type the IP address of your repository host in Trigger IP Addresses.
- Click Save Trigger.
Screenshot: Build Strategy – repository triggers the build when changes are committed
Attachments:








