Does a programmatic method exist to create Linked Repositories?

I'm leveraging all of the goodness of Spec Plans, but it depends heavily on an existing Linked Repository.

Here is what I have so far:

Step 1 - Use the Bitbucket API to setup a code repository [scripted]

Step 2 - Log into Bitbucket, create 'Linked Repository' (LR) to new code repo [manual]

Step 3 - Execute java Spec Plan to create a Bamboo Build Plan (linked to the LR) [scripted]

You can see the significant interrupt in my attempt to create a push-button setup.

 

The closest I find is Bob Swift's CLI tool. While neat, I don't have local Bamboo Admin access.

All actions must be via API or remotely.

Thanks in advance!

2 answers

2 votes

Try Bamboo Specs for linked repositories management

BambooServer bambooServer = new BambooServer("http://localhost:6990/bamboo");
final GitRepository gitRepository = new GitRepository()
.name("Test repository")
.url("https://bitbucket.org/user/test.git")
.branch("master")
.authentication(new UserPasswordAuthentication("user")
.password("password"))
.changeDetection(new VcsChangeDetection());
bambooServer.publish(gitRepository);

Thanks Alexey, but a recent article indicates that global linked repository are preferred and that manually configured repository are to be deprecated. So I was hoping to adopt the preferred method. 

Article - https://confluence.atlassian.com/bamboo/linking-to-source-code-repositories-671089223.html

This code creates global linked repository

0 votes

Hi Chad,

Bamboo does not provide the REST end point to create a new linked repository (yet as of Bamboo 6.4.1). I found an open feature request for this - BAM-18453

I recommend you vote for it and comment to get it prioritised.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

76 views 3 3
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you