Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

bamboo specs include file with multiple documents

Dave Attard February 22, 2023

I am looking at "trying" to streamline my bamboo-spec repo and want to do the following

  • the bamboo.yml file will incude only the high level scripts, not the 100's of scripts that i currently directly include
  • the build.yml file would have includes for all the build specs
  • the deployment.yml file would have includes for all the deployment specs
  • ServiceA_deployment.yml file would have the deployment document and the permissions for that deployment (ie:
---
version: 2
deployment:
name: My deployment
source-plan: PLAN-KEY
release-naming:
next-version-name: release-1.0
applies-to-branches: true
auto-increment: true
auto-increment-variables:
- quickCompileMavenGoals.experimental
environments:
- QA
QA:
tasks:
- clean
- artifact-download:
destination: /workdir
- script:
- echo 'hello world'
- echo "I’m done"
---
version: 2
deployment:
name: My deployment

deployment-permissions:
- users:
- local-admin
- remote-admin
groups:
- bamboo-remote-users
permissions:
- view
- edit

Error

However i am getting error

23-Feb-2023 16:53:25	Bamboo YAML import failed: Invalid format of the YAML file: expected a single document in the stream
23-Feb-2023 16:53:25	 in 'reader', line 2, column 1:
23-Feb-2023 16:53:25	    !include 'BUILD/ServiceA_Build.yml- ... 
23-Feb-2023 16:53:25	    ^
23-Feb-2023 16:53:25	but found another document
23-Feb-2023 16:53:25	 in 'reader', line 3, column 1:
23-Feb-2023 16:53:25	    ---
23-Feb-2023 16:53:25	    ^

 

Proposed structure

bamboo-specs
|- bamboo.yml
|- build.yml
|- deployment.yml
|- COMMON
|- DotNet_build-task.yml
|- BUILD
|- ServiceA_Build.yml
|- ServiceB_Build.yml
|- DEPLOYMENT
|- ServiceA_deployment.yml
|- ServiceB_deployment.yml

 

bamboo.yml

---
!include 'build.yml'
---
!include 'deployment.yml'

build.yml

---
!include 'BUILD/ServiceA_Build.yml'
---
!include 'BUILD/ServiceB_Build.yml'

deployment.yml

---
!include 'BUILD/ServiceA_deployment.yml'
---
!include 'BUILD/ServiceB_deployment.yml'

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.2.1
TAGS
AUG Leaders

Atlassian Community Events