Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why plan created in bamboo_specs/bamboo.yml is default to read only?

Hi I'm new to Bamboo and would love to use YAML specs for setting up plan for each of my service application.  Currently when my attempt of creating a plan, I'm getting read only plan which no one can use.  I've tried using the "plan-permissions:" as part of the plan, it is throwing exception that "plan-permissions" is an unknown property of the plan.

 

I'm using Bamboo 6.9.2 and plan permission only work when running through Java Specs.

 

Thanks,

Vinny

2 answers

1 vote

Hi @Vinh Hong ,

Thank you for raising this question.

Why plan created in bamboo_specs/bamboo.yml is default to read only?

The intention of this design is to be able to control the plan configuration only from the repository side. This allows you to always have a way to restore an old configuration and also assure your code will be built with the correct build configuration.

Regarding the plan permissions, it is a different story. We recently implemented multiple document sections (called documents) in a YAML file. They are better described here:

It means that you need a different section to declare the plan permissions and that is why Bamboo was not able to identify the "plan-permissions" property.

This is an example that would work. It has two document parts:

version: 2
plan:
project-key: SPEC
key: PLAN
name: My Plan

stages:
- Stage 1:
jobs:
- Job 1

Job 1:
tasks:
- script:
- echo 'Hello from YAML Specs'

---
version: 2

plan: SPEC-PLAN
plan-permissions:
- users: admin
groups: bamboo-admin
roles: logged-in
permissions: view


You may be asking why we have this implementation. We did it to allow these document parts to be set in a completely different repository with different ownership/permissions.

Assuming the information about the different documents was not clear, I've created the following ticket as an improvement suggestion:

I hope that helps you to move forward.

I've attemped above multi-documents in a single yaml file, I'm getting this error.

Bamboo YAML import failed: Invalid format of the YAML file: expected a single document in the stream
 in 'reader', line 1, column 1:
    version: 2
    ^
but found another document
 in 'reader', line 77, column 1:
    --- 

 Here is my bamboo.yml

version: 2
plan:
  project-key: VINNY
  key: PLAN
  name: Test Plan

stages:
  - Default Stage:
      jobs:
        - Build Application

Build Application:
  requirements:
#    - Maven 3
#    - os: centos \d+
    - JDK 1.8

  artifacts:
    - name: Shell Application
      location: target
      pattern: 'my_app.sh'
      shared: true

  tasks:
    - clean
    - script: |
         #!/bin/bash
         mkdir target
         my_app=my_app.sh
         cat >target/${my_app} <<EOT
         ls -l
         pwd
         echo "Welcome to my test app"
         echo "======================================="
         env
         EOT
         war=target/testapp.war
         touch ${war}
         echo "Not a war file" > ${war}
         echo "Trigger build run" >> ${war}
ls -l
         ls -l target/*
         echo "Build Completed"

---
version: 2
plan: SPEC-PLAN
plan-permissions:
  - users: admin
    groups: bamboo-admin
    roles: logged-in
    permissions: view

Anyway, I like the concept of YAML Specs as it is simple to use and learn.  This allows developers to quickly adopt to the product where a great learning curve is need to navigate the UI.

 

It might be an issue related to the plan key used for the plan permissions. Try changing

plan: SPEC-PLAN

to 

plan: VINNY-PLAN

 and let me know what happens.

I was able to make it work with this change.

Same error.

 

It seems it doesn't like multi-documents.  Is there specific setting that I need to activate?

Anyway, found a work around by having my bamboo_specs/bamboo.yml pull in each of the doc.

!include 'planA.yml'
---
!include 'planAPermssions.yml'
Like # people like this

Hi @Vinh Hong

I'm glad you found a workaround, but as I mentioned I was able to make it work in 6.9.2 with the same code you posted here.

I noticed a strange thing, you have an error in line 77, but the code posted here don't have 77 lines. Maybe the error was in a different part that was omitted?

If you don't want to investigate what caused the error I understand, but that made me curious.

By the way, thank you for sharing your workaround. I learned something new!

Like Steffen Opel _Utoolity_ likes this

Half a day lost because the documentation on

https://docs.atlassian.com/bamboo-specs-docs/6.9.0/specs.html?yaml#plan-permissions

did not pointed out to write it in this way.

 

Side note:

I see a lot of documentation and implemetation and this is by far the worst one

WebSphere in its first version was better than this. Sorry.

Hi @Jens Mühlenhoff

Thank you for the feedback.

Do you mind sharing your ideas on how this document could be improved?

I recently created a couple of requests to improve this doc, but I'm pretty sure there is more to be done. 

Thank you!

@Daniel Santos  Maybe the bamboo yaml file settings should be mentioned somewhere on this page: https://confluence.atlassian.com/bamboo/configuring-a-plan-s-permissions-289276858.html andpossibly mentioned on this page since it is a related topic:  https://confluence.atlassian.com/bamboo/configuring-project-permissions-938840042.html 

Like Daniel Santos likes this

Thank you so much @Tim Watts

I'll raise a request for that to our tech writers!!!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

190 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you