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

Bamboo specs - BitbucketServerRepository::sshPrivateKey does not work Edited

I have problem with Bamboo Specs for Bamboo 6.3.1.

I want to set own Private/Public key for BitbucketServerRepository like

 project_key = _project_key;
repository_slug = _repository_slug;
branch_name = branch;
ApplicationLink link = new ApplicationLink()
.name(Main.BITBUCKET_NAME);
this.sshPrivateKey(load_private_ssh_key());
this.sshPublicKey(load_public_ssh_key());
this.server(link);
this.sshCloneUrl("ssh://<server>" + project_key + "/" + repository_slug + ".git");
this.repositorySlug(repository_slug);
this.projectKey(project_key);
this.name(Main.BITBUCKET_BAMBOO_NAME + project_key + repository_slug + branch);
this.branch(branch);
this.submodulesEnabled(true);
this.commandTimeoutInMinutes(120);
this.remoteAgentCacheEnabled(false);
this.fetchWholeRepository(true);

(Replace <server> with valid server address)

Everything publish without problems, but Bamboo generate NEW keys in my Bitbucket server even if I have specified private/public pair.

What's wrong?

 

Thans for any advise :),

John

1 answer

1 accepted

0 votes
Answer accepted

Hi @koudis,

If you want to make use of your own SSH key, then you should be looking at https://docs.atlassian.com/bamboo-specs-docs/6.3.1/specs-java.html#git, creating a "new GitRepository()", however, since you are setting up a Bitbucket Server repository in Bamboo, you should let Bamboo manage the SSH keys on your behalf. This is the same behavior as when creating a Bitbucket Server repository from Bamboo's UI.

Could you please attempt on running the following instead (doing the replaces), letting us know how it goes.

Plan plan = new Plan(project, planName, planKey)
    .planRepositories(new BitbucketServerRepository()
        .name("my-bitbucket-repository")
        .server(bitbucketServerApplink)
        .projectKey("BBSPROJECT")
        .repositorySlug("my-repository-slug")
        .branch("master")
        .sshPrivateKey(sshPrivateKey)
        .sshPublicKey(sshPublicKey));

Extracted from Bitbucket Server Git repository - Authentication

Furthermore, it is recommended making use of Bitbucket Server as Repository Host over Git due to Benefits of integration

Kind regards,

Rafael

It does not work. 

If I publish Plan by SPECS and set explicit Private/public keys in repository configurations   it generetes own set of private/public keys and ignored my pp pair.

 

 

@rsperafico It does not work. 

If I publish Plan by SPECS and set explicit Private/public keys in repository configuration   it generetes own set of private/public keys and ignored my pp pair.

rsperafico Atlassian Team Jul 30, 2018

Hi @koudis,

Thank you for your update.

A bug has been filed in our issue tracker (https://jira.atlassian.com/browse/BAM-20012 - Cannot set up custom SSH keys in Bamboo Java Specs) describing the issue you have reported.

Whilst the issue is not addressed, please continue on using Bitbucket Server as Repository Host instead of Git due to Benefits of integration and let Bamboo manage the SSH keys for you.

Kind regards,

Rafael

@rsperafico We upgraded to Bamboo 6.6.1 - same problem.

rsperafico Atlassian Team Jul 31, 2018

Hi @koudis,

Thank you for your update.

There was no need to upgrade Bamboo 6.6.1 as the bug raised (https://jira.atlassian.com/browse/BAM-20012 - Cannot set up custom SSH keys in Bamboo Java Specs) already mention the feature is not working as described in documentation, but thank you for the effort.

If you visit the link mentioned, you should find Fix Version/s: in it, in which describes in which version the bug will have its fix.

Kind regards,

Rafael

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 ...

179 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