Bamboo YAML Specs

As an alternative to using Bamboo Java Specs, Bamboo 6.3+ allows you to create simple plans using Bamboo YAML Specs in no time. Just use one of the templates we provide and you're ready to start committing your files to a repository. 

How it works

Bamboo YAML Specs is another Bamboo Specs format supported by Bamboo next to Bamboo Specs Java. Once you have defined your plan/deployment configuration in YAML, you need to allow your repository to scan for Bamboo Specs.

Bamboo always looks for YAML Specs first. If it doesn't find YAML Specs, Bamboo tries to find and process Java Specs. 

In the repository you specified, Bamboo looks for bamboo-specs/bamboo.yml or bamboo-specs/bamboo.yaml files to fetch your configuration. Linked repository needs to have permissions to create plans within given project in order to process YAML definition and create a plan. 

A new plan created using Bamboo YAML Specs does not have any explicit permissions granted - administrators and logged in users will have access to it. You can use YAML Specs to define plan-level permissions. We advise you to use project-level permissions. Contrary to Java Specs, YAML Specs can't create projects. 

In Bamboo YAML Specs, artifacts are shared by default. Artifacts are downloaded between stages, e.g user Defines Stage 1 with Artifact A, Stage 2 with Artifact B and Stage 3. This means that Stage 2 will download Artifact A from Stage 1 and Stage 3 will download both Artifact A and B from previous stages. 

In Bamboo YAML Specs, artifacts are also required by default. This means that a build fails if the artifact can't be published. 

YAML Format

Bamboo Specs YAML allows for a multiple entities definition in a single YAML file and accepts the following format:

version: 2
  project-key: MARS
  key: ROCKET
  name: Build the rockets

# List of plan's stages and jobs
  - Build the rocket stage:
    - Build

#Job definition
    - script:
        - mkdir -p falcon/red
        - echo wings > falcon/red/wings
        - sleep 1
        - echo 'Built it'
    - test-parser:
        type: junit
        test-results: '**/junit/*.xml' 
  # Job's requirements
     - isRocketFuel
  # Job's artifacts. Artifacts are shared by default.
     - name: Red rocket built
       pattern: falcon/red/wings
version: 2
  name: Deploy Rocket
  source-plan: MARS-ROCKET

  next-version-name: 0.${bamboo.buildNumber}

  - QA

    - clean
    - artifact-download:
        destination: /
    - script:
        - echo 'Hello space'

Default settings

Here's the default settings of plans created using YAML Specs.

These settings cannot be changed:

  • notifications are sent to committers and watchers of the plan when plan fails
  • default repository is one with YAML Specs file. All plan branches will use it.

These settings can be changed:

  • Bamboo YAML plan check-out starts with checking out a repository in which it's defined. But if first task is checkout task which uses another linked repository then checkout from repo with YAML Specs file will be skipped.
  • artifacts sharing is turned on
  • YAML plans use Bitbucket Server triggers
  • only Bamboo administrators can see plan configuration and run builds
  • logged in users can view plan builds
  • plan branches are created automatically with plan brach expiry set for 30 days. These settings are configurable.

Read more

Last modified on Oct 4, 2023

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.