There are a number of ways in which a build can be triggered for a plan,
- Build Strategy:
- Code updated — a build can be triggered whenever one or more authors checks-in code.
- Scheduled build — a build can be scheduled to occur at regular intervals.
- Manual build — a build can be triggered manually.
- Initial clean build — a build will be triggered when a new plan is created.
- Build Dependency:
- Dependency — a build can be triggered whenever a successful build occurs for another plan.
The way in which each build was triggered is listed in the 'Reason' column on the Dashboard.
Build Dependencies and Build Strategies
Build dependencies are "parent-child" relationships between builds that can you can configure to trigger builds. See Setting up Build Dependencies.
Build dependencies work together with the build strategy to trigger builds. For example, you can set up your build plan to poll your repository for changes as well as configure build dependencies between builds. In this case, your builds will be triggered when code changes are detected as well as when parent builds complete successfully.
If you want your builds to only be triggered by successful parent builds from your build dependencies, you can do this by specifying "manual & dependent builds only" as the build strategy for your plan. See Triggering a Build Manually.
Considerations for choosing a Build Strategy
Code Updated
Triggering a build when code is updated ensures that a build only occurs when necessary. There are two ways to trigger a build when code is updated:
- "Pull strategy" — Polling the repository for code changes means that Bamboo will check-out the source-code on a regular basis, and examine it for changes. If Bamboo detects a change, it will trigger a build.
See Polling the Repository for Code Changes.
- "Push strategy" — 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.
See Triggering a Build on Code Check-in.
Scheduled Build
Triggering a build on schedule can allow a team to structure the day according to a predictable schedule. Note that scheduled builds are run regardless of whether or not any code changes have occurred. There are two ways to schedule a build:
- Single Daily Build — A single daily build runs at a time of your choice. This is particularly suitable for builds that take a long time to complete. See Scheduling a Single Daily Build.
- Cron-Based Scheduling — A cron-based schedule allows you to schedule builds according to a flexible cron expression. For example, "0 0/30 9-19 ? * MON-FRI" would trigger a build every half-an-hour from 9am to 7pm, Monday to Friday. See Specifying a Cron-based Schedule.
Manual and Dependent Builds
Triggering a build manually or by build dependencies allows you to ensure that builds are only triggered manually or by parent builds of dependent builds (as described in the 'Build Dependencies and Build Strategies' section above). See Triggering a Build Manually