Does a programmatic method exist to create Linked Repositories?

Chad Benn I'm New Here Mar 30, 2018

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);
Chad Benn I'm New Here Apr 04, 2018

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,324 views 0 5
Read article

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