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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Bamboo yaml spec, create plan repositories


Hi there,

I followed the documentation of Bamboo Yaml specs to create plan repositories as below.

 - my-test:
       type: bitbucket-server
       server: http://localhost:7990
       project: TestProject
       slug: test-service
       clone-url: ssh://
       public-key: PUBLIC KEY
       private-key: ENCRYPTED_PRIVATE_KEY

I provided the actual public key and private key in the yaml and the pulic key is configured in the bit bucket server to my account.  When tried like this I am the error. 

Cannot read keypair, passphrase wasn't set

 But I am not sure how I should provide the passphrase.


And when I remove public-key and private-key fields I get below error.

Bamboo YAML import failed: Repository 'my-test' should be defined at 'repositories' list when referenced by Checkout task

Can someone help me here ?

1 answer

1 accepted

1 vote
Answer accepted

Hello @sasank nvs, Welcome to Atlassian Community!

To use an SSH private key with a passphrase, you should set the repository type as "git" and on your YAML file:

ssh-key: <Encryptedkey>
ssh-key-passphrase: <EncryptedPassphrase>

To generate an encrypted string to Specs -> Bamboo Specs Encryption (located on the top menu bar in Bamboo)

When using a Bitbucket-server repository type, Bamboo takes over SSH key management and won't allow personal keys to be used, nor passphrases.



Eduardo Alvarenga
Atlassian Support APAC

Thanks @Eduardo Alvarenga for such a prompt reply. I was able to get it worked with git. But not able to get it working with Bitbucket. I tried below configuration but still I got the error. Also I don't have any access token configured on the Bitbucket repository.

- my-test:
    type: bitbucket-server
    server: Bitbucket
    project: testproject
    slug: test-service
    clone-url: ssh://

Bamboo YAML import failed: Repository 'my-test' should be defined at 'repositories' list when referenced by Checkout task

I got the above error. 

You are missing a repository declaration. Try this:

Default Job:
key: JOB1
- checkout:
repository: my-test
force-clean-build: 'false'
description: Checkout My-test

- my-test:
    type: bitbucket-server
    server: Bitbucket
    project: testproject
    slug: test-service
    clone-url: ssh://

Hello Eduardo,

I work together with Sasank on this issue and just figured out the solution

- The provided SSH key pair must be RSA keys (not OpenSSH)
- The public key is plain, the private key must be Bamboo encrypted
- The property viewer with the following value is required (otherwise an error message saying that changing the repo type is not allowed is thrown)
viewer: com.atlassian.bamboo.plugins.stash.atlassian-bamboo-plugin-stash:bbServerViewer
- I also added the public key to the bitbucket repo keys (in bitbucket project settings)

The final piece of repo config in the bamboo YAML spec looks like the following

- my-test:
type: bitbucket-server
server: <bit bucket app link name>
project: <project-key>
slug: <repo-slug>
clone-url: <ssh-git-repo>
public-key: <public-key>
private-key: <private-key>
branch: master
viewer: com.atlassian.bamboo.plugins.stash.atlassian-bamboo-plugin-stash:bbServerViewer

As far as I have seen, all properties here are mandatory.

We would also like to specify the "Change detection part", especially to include only changes that matches a specific RegEx.

Unfortunately I couldn't find this part in the YAML specs reference, do you have hint for us?

Hey @Dimitri Dering @sasank nvs

I noticed the similarity between your work questions but didn't want to assume you teamed. But now that everything is clear, that makes things easier to understand.

Regarding the Change detection options, you can try adding something like this:

- my-test:
file-filter-type: include_only
file-filter-pattern: ^(string1|string2)/.*

Modify the file-filter-pattern regex to what suits you.

Pro-tip. You can always use the Bamboo UI to export the Plan in either YAML or Java Specs format. For that, simply prepare your plan, then go to:

  • Actions -> Configure Plan -> Actions -> View Plan as (Java/YAML) Specs
Like Dimitri Dering likes this

perfect, this solved our issue completely

thank you very much

Thanks @Dimitri Dering. Please make sure to mark this question as Resolved.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events