How to choose the right DevOps tools - Part 2 Configuration As Code

by Ilona

August 10, 2021

Configuration as code is available in Bamboo and this feature is called Bamboo Specs.

Configuration as code allows the entire configuration of Bamboo plans to be stored as source code. It moves the management of plans from the Bamboo UI to the developer's integrated development environment (IDE), and this approach brings a lot of benefits.

Bamboo Specs

The Bamboo Specs allow you to define plan configuration as code and send it to Bamboo to have corresponding plans created or updated automatically. In case you are looking for detailed documentation about a specific method or class, you can find it in Bamboo Specs API

Our Bamboo Specs tips:
  • Use script tasks wherever possible as they are easier to test locally compared to Bamboo tasks
  • Use the Bamboo specs plan exporter (Plan configuration -> Actions -> View Plan as Java Specs) to get a working spec instead of starting from scratch
  • Before publishing the specs with `mvn -Ppublish-specs`, do an offline test beforehand with `mvn test`.
  • Store your specs version-controlled in Bitbucket and use PR's for code review when they need to change
    1. In order to export an existing build plan to Bamboo Specs source code:
    2. If you don't have a Bamboo Specs project, create one
    3. Go to your build plan and select
    4. Actions > Configure plan
    5. On the plan configuration page, select
    6. Actions > View plan as Java Specs
    7. Copy generated Java code to your code editor by putting it in the PlanSpec#createPlan method for instance