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

Bamboo YAML specs: use shared credentials with bitbucket server repository

pBogey November 27, 2024

Hi, I'm using bamboo YAML specs. In the repositories config I have defined some repos as bitbucket server repos, which seem to require ssh public and private key for authentication, as per the docs.

 

Anyway, there is also the possibility to create SSH shared credentials at project level and reuse in all the plans: 

https://confluence.atlassian.com/bamboo/shared-credentials-424313357.html

 

I have tried to use this with the bitbucket server type repo in YAML specs and it doesn't seem to work. I get an error like this:

 

Bamboo YAML import failed: Document structure is incorrect: Found following unused properties: repositories / [1] / {repoName} / shared-credentials.
Every property must have a correct key recognizable by Bamboo and must be used as part of the configuration in the current YAML document. Common sources of these problems are typos in properties keys, unused jobs, and mixing a plan and its permissions configuration in one YAML document.


The config looked something like this:

repositories:
- repoName:
type: bitbucket-server
server: BitbucketServer
project: ProjectName
slug: repoName
clone-url: ssh://git@bitbucket.com/project/repo.git
branch: ${bamboo.repoName_branch}
viewer: com.atlassian.bamboo.plugins.stash.atlassian-bamboo-plugin-stash:bbServerViewer
shared-credentials:
name: SharedUserCreds
scope: project

 

In order to make it work, I had to configure it like this:

repositories:
- repoName:
type: git
url: ssh://git@bitbucket.com/project/repo.git
branch: ${bamboo.repoName_branch}
shared-credentials:
name: SharedUserCreds
scope: project
viewer:
com.atlassian.bamboo.webRepositoryViewer.stash:stashRepositoryViewer:
webRepository.stash:
project: ProjectName
repositoryName: repoName
url: https://bitbucket.com

 

Notice the legacy Stash viewer used, because git repos do not support bbServerViewer.


I don't understand why I could use the shared credentials for a plain git repo, but not for the bitbucket server type of repo. It doesn't make sense, am I missing something or is this a real limitation?

 

I am defining repositories like this and not using linked repos, because I want to be able to override the branch with custom runs (https://jira.atlassian.com/browse/BAM-21066).

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events