Run builds automatically
In Build Automation, you can configure your project to build automatically when you push changes to your repository, or you can set up recurring builds on a defined schedule. These features work independently and suit different workflows.
Set up Automatic Builds
Auto-build automatically triggers a new build when you commit changes to your repository. This ensures your project is consistently built with the latest updates:
- A build triggers every time a new change is pushed to the repository.
- If you enable Auto-cancel, any pending or ongoing build automatically cancels when a new change is pushed, which ensures only the most recent changes build.
Auto-build is perfect for workflows that require continuous integration, because it ensures a build triggers for the latest changes without manual intervention.
Set Scheduled Builds
Scheduled builds allow you to automatically start builds at defined intervals, regardless of repository activity. Schedules builds help to ensure that you have regular builds, such as nightly builds or scheduled testing.
When you configure a scheduled build, you can specify the following details:
- The frequency: Once, Daily, Weekly, Monthly, Yearly or Cron.
- The date and time for the build to start or a Cron expression.
- Whether to use build caching.
Scheduled builds are ideal to maintain regular build cycles and ensure you have a reliable build at specific times even if no new changes have been pushed.
There's no limit to the number of schedules you can create for a project, but you can only set up one schedule for each build target. To create multiple schedules for a project, you need to create additional build targets.
Run Builds Using Build Automation API
In addition to Auto-build and scheduled builds, you can programmatically trigger builds using the Build Automation API. This approach is ideal for workflows that require custom build triggers, such as to integrate build processes with external systems, or when you need more granular control over how and when builds trigger.
The Build Automation API allows you to do the following tasks:
- Trigger a build for a specific build configuration
- Check the status of a build attempt
- Cancel a build
- Access build history
For detailed API documentation and additional functionality, you can refer to the Build Automation API Documentation.