Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

bamboo-spec include not working for common job

Edited

I have build plans working with bamboo-specs and i would like to pull out the common parts into an include. I have read and re-read the specs and i cant work it out

bamboo-specs
| - bamboo.yml
| - Services
| - build-ServiceA.yml
   | - build-ServiceB.yml
| - Common
| - build-job.yml
---
!include 'Services\build-ServiceA.yml'
---
!include 'Services\build-ServiceB.yml'

folder\build-ServiceA.yml-> working

---
version: 2
plan:
project-key: XXX
key: XXXXX
name: Build Service
stages:
- Build:
jobs:
- Build-Service
Build-Service:
key: JOB1
tasks:
- clean
- script:
interpreter: WINDOWS_POWER_SHELL
scripts:
- |-
Set-Location ./${bamboo.solution}
dotnet restore -v q
description: Restore
- script:
interpreter: WINDOWS_POWER_SHELL
scripts:
- |-
Set-Location ./${bamboo.solution}/${bamboo.serviceFolder}
dotnet publish -c Release -v q -o ${bamboo.working.directory}/packages
description: publish
artifacts:
- name: ${bamboo.solution}
location: packages
pattern: '**/*'
shared: true
required: true
artifact-subscriptions: []
variables:
solution: service
serviceFolder: folder
triggers: []
repositories:
- Repo
branches:
create:
for-new-branch: (release|feature)/.+
delete:
after-deleted-days: 1
after-inactive-days: 30
link-to-jira: true

 

What i would like to do is move the Build-Service job into a common include file. Looking at the spec information on includes i should be able to do this. However when i make the changes

folder\build-ServiceA.yml-> error 

Bamboo YAML import failed: Invalid format of the YAML file: Include file ..\COMMON\build-job.yaml does not exist
---
version: 2
plan:
project-key: XXX
key: XXXXX
name: Build Service
stages:
- Build:
jobs:
- Build-Service

Build-Service: !include '..\common\build-job.yml'

triggers: []
repositories:
- Repo
branches:
create:
for-new-branch: (release|feature)/.+
delete:
after-deleted-days: 1
after-inactive-days: 30
link-to-jira: true

common\build-job.yml

  tasks:
- clean
- script:
interpreter: WINDOWS_POWER_SHELL
scripts:
- |-
Set-Location ./${bamboo.solution}
dotnet restore -v q
description: Restore
- script:
interpreter: WINDOWS_POWER_SHELL
scripts:
- |-
Set-Location ./${bamboo.solution}/${bamboo.serviceFolder}
dotnet publish -c Release -v q -o ${bamboo.working.directory}/packages
description: publish
artifacts:
- name: ${bamboo.solution}
location: packages
pattern: '**/*'
shared: true
required: true
artifact-subscriptions: []

 

1 answer

1 accepted

2 votes
Answer accepted
Build-Service: !include 'common\build-job.yml'

Suggest an answer

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

Atlassian Community Events