Hello,
Im trying to setup a base plan via yaml specs which should be used to create actual plans via includes. So I have created several files which are included in a test plan like this:
---
version: 2
plan:
project-key: SOMEPROJECT
key: SPECTEST
name: Test Plan
description: deploy to target
notifications: !include 'base-notifications.yaml'
repositories: !include 'base-repositories.yaml'
<SNIP>
Im trying to do the same for the plan variables that all plans that are going to use this as base should include, but the actual plans should also be able to add some additional vars or overwrite existing ones.
The file named base-variables.yaml has an example content like this:
somevar: somevalue
anothervar: anothervalue
I have tried a lot of different ways to achieve this but it seems that its not possible to do something like this:
variables: !include 'base-variables.yaml'
<<: { additional-var, additional-value }
This results in the below error:
27-Sep-2022 07:22:46 Bamboo YAML import failed: Invalid format of the YAML file: while parsing a block mapping
27-Sep-2022 07:22:46 in 'reader', line 2, column 1:
27-Sep-2022 07:22:46 version: 2
27-Sep-2022 07:22:46 ^
27-Sep-2022 07:22:46 expected <block end>, but found '<block mapping start>'
27-Sep-2022 07:22:46 in 'reader', line 10, column 3:
27-Sep-2022 07:22:46 <<: { additional-var: additional-value }
27-Sep-2022 07:22:46 ^
27-Sep-2022 07:22:46 Also tried something like this:
base-variables: &basevars !include 'base-variables.yaml'
plan-specific-vars: &planvars
somekey: somevalue
variables:
<<: *basevars
<<: *planvars
But that caused an issue because the properties base-variables and plan-specific-vars are not actually used.
How can I achieve the described outcome without having to list all variables in all plans?