2

We currently have multiple Bamboo plans that have common stages/jobs/tasks. We just moved to using Bamboo Specs and I would like to pull each common section out into a single "module" so I only have to make changes in one location. From what I have read this should be a possibility but cannot find any examples of this being done and I'm not a Java developer.

Can anyone let me know how to pull these out so I can make it common across multiple plans?

Jason Templeman
  • 431
  • 5
  • 21
  • I have an example of repository here that you may use: https://bitbucket.org/renficiaud/bamboo-java-specs/ . Some explanations on the structure are given here: https://yayimorphology.org/bamboo-specs-project-sharing.html – Raffi May 21 '20 at 08:19

1 Answers1

0

Yes, this is possible. When using YAML Specs, you can use the !include 'file.yaml' tag. See https://docs.atlassian.com/bamboo-specs-docs/latest/specs.html?yaml#includes

Some things to remember:

  • the file path of the included file is always relative to the /bamboo-specs directory
  • You can include full YAML documents or objects
  • Your YAML Spec file must still be valid YAML. (Note: `!include 'file.yaml' is considered a SCALAR value)

Valid syntax: Build: !include 'builds/build-job.yaml'

Invalid syntax:
Build:
!include 'builds/build-job.yaml'
description: builds project
This is invalid because the value of Build cannot include both a scalar value and key-value pairs.

Invalid syntax (rejected syntax): Build: &buildJob !include 'builds/build-job.yaml'

B Shelton
  • 134
  • 4