Software teams often run automated Bamboo builds every time after committing changes to the repository. This is a typical DevOps automation use case, but there are scenarios where more flexibility and customization are needed.
As a frequent use case, you need to make running a time-consuming Bamboo build on commit optional. For this, you can turn to the free Better DevOps Automation for Jira app. This is a Jira app which extends Automation for Jira with development-related triggers.
You can freely combine the development automation triggers with the built-in Automation for Jira actions to implement a wide range of custom DevOps workflows. If you are new to Better DevOps Automation, also read this comprehensive introductory blog to learn more about automating development processes on Jira Data Center.
Do you prefer a tutorial video? Watch how to create an automation rule for triggering a Bamboo build on commit!
Trigger a Bamboo build automatically on commit
Let's look at a DevOps automation rule that will only trigger a Bamboo build if you use the command "@build" in your commit message.
With this command, you can control from the commit message, whether you want to run a Bamboo build plan after that commit or not. This can be useful for running expensive builds only when necessary or for situations where you want to give more flexible control to developers over running Bamboo builds.
Create a new Automation for Jira rule and choose the Genius Commit created trigger from the DevOps category.
Choose the command "Build (@build)" from the list of built-in commands.
Select the Send web request automation action
Supply your Webhook URL for Bamboo:
Replace the placeholders with your actual Bamboo base URL, the Bamboo project key, a hyphen character ("-") and the plan key.
Add a header with the name "Authorization" and with the value of the Base64 encoded Bamboo credentials.
Add another header named "Content-Length" with the value "0".
Save and turn on your automation rule
This rule above will run the Bamboo build hard-wired in the webhook URL. Your team probably has more than one build plan in Bamboo, so it's a realistic requirement to define also the build plan key or plan parameters in the commit message.
Ready to give this Bamboo build automation a whirl?