đź’° Better DevOps Automation for Jira launch discount: 50% OFF all licenses! (limited to the first 100) Learn more →

How to trigger a Bamboo build on commit?

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 Better DevOps Automation for Jira. 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 and Jira Server deployments.

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.

Steps:

  1. Create a new Automation for Jira rule and choose the Genius Commit created trigger from the DevOps category.

  2. Choose the command "Build (@build)" from the list of built-in commands.

  3. Select the Send web request automation action

    Supply your Webhook URL for Bamboo:

    _<YOUR_BAMBOO_SERVER_BASE_URL>/rest/api/latest/queue/<YOUR_BAMBOO_PROJECT_KEY>-<BAMBOO_PLAN_KEY>

    Replace the placeholders with your actual Bamboo base URL, the Bamboo project key, a hyphen character ("-") and the plan key.

  4. Add a header with the name "Authorization" and with the value of the Base64 encoded Bamboo credentials.

  5. Add another header named "Content-Length" with the value "0".

  6. 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?

Trigger automatic Bamboo builds!

 

Be the first to hear about the Midori news, Jira, Confluence, Bitbucket guides, and productivity tips that accelerate your team.

Subscribe now