Triggering a build on code check-in has the advantage of placing minimal load on your Bamboo server, but requires that your source-code repository is configured to fire an event to the Bamboo server.
Step 1. Configure your source repository
- Configure your source-code repository to run post-commit scripts to tell Bamboo whenever a code commit has occurred.
- For CVS, edit two files in the CVSROOT module:
commitinfoandloginfo.
- For
commitinfoadd a line like this:where "jira" is your module.^jira(/|$) /pathto/preCommit.sh
- For
loginfoadd a line like this:where JIRA-MAIN and JIRA-BRANCH are the Bamboo plans that you would like to trigger.^jira(/|$) /pathto/postCommitBuildTrigger.sh %{} http://bambooserver JIRA-MAIN JIRA-BRANCH
- For
- For Subversion, edit the Subversion respository's
hooks/post-committrigger file with something like:/pathto/postCommitBuildTrigger.sh http://bambooserver JIRA-MAIN JIRA-BRANCH
- For Perforce, add the script as a change-commit trigger.
triggerName change-commit //myDepot/... "/usr/local/bin/postCommitBuildTrigger.sh http://bambooServer/ MYPLAN-DEFAULT"
- For CVS, edit two files in the CVSROOT module:
- Copy the scripts to your repository. If you are using Bamboo Standalone, the scripts are located in the
/scriptsfolder of your Bamboo Installation Directory. If you are using Bamboo EAR-WAR you can find them in the/repositoryScriptsfolder. 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.
Step 2. Configure Bamboo to trigger a build on code check-in
- Click 'Home' to go to the Dashboard.
- Click the 'All Plans' tab.
- Locate the plan in the list and click this icon:

- The 'Configuration' tab will be displayed. Click the 'Source Repository' sub-tab.
- In the 'Build Strategy' field, select 'Repository triggers the build when changes are committed' (see screenshot below).
- This will display the 'Trigger IP Address' field. If you want Bamboo to receive post-commit notifications from the respository's primary IP address, leave the 'Trigger IP Address' field blank. If you want Bamboo to receive post-commit notifications from a different IP address, type the IP address in the 'Trigger IP Address' field.
- Click the 'Save' button.
Screenshot: 'Plan Configuration--Source Repository-Build Strategy: Repository triggers the build when changes are committed'
RELATED TOPICS
- 3.1 About Build Triggering
- 3.2 Triggering a Build when Code is Updated
- 3.3 Triggering a Build on Schedule
- 3.4 Triggering a Build when another Build finishes
- 3.5 Triggering a Build Manually
Bamboo Documentation
Labels






