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
Published Wednesday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

74 views 0 1
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