How can I use a Git repository in a Bamboo Deployment Project?

My Bamboo server is currently version 5.3 build 4101. I want to use a deployment script that's stored within the project's git repo as one of the steps for the deployment project.

When I edit the tasks for an environment in the deployment project, it allows me to add a Source Code Checkout task and it includes a message "Typically, this is used for accessing scripts required for your deployment. However, any compilation and packaging of code should be performed in the plan related to this Deployment Project and the result of the packaging shared via Artifact Sharing" that makes me think that it's intended to be supported. However, the Repository drop-down is empty, doesn't allow selections, and I can't figure out how to get a repository to show up there. If I save the Source Code Checkout task with the repository field blank, it doesn't do anything when the environment is deployed.

Is there a way to get the Source Code Checkout task working in a deployment project?

3 answers

1 accepted

1 vote
Accepted answer

You need define your repository as 'Shared Repository': Administration -> Shared Repositories (in version <= 5.4 nomenclature; it's called Linked Repository in 5.5).

You can convert your existing repository to shared by going to it's configuration and clicking on 'Convert to shared repository' link. (you need to be Bamboo admin for this)

Please note that checkout task in Deployment project always updates to the tip of the git branch.

0 votes

You need define your repository as 'Shared Repository': Administration -> Shared Repositories (in version <= 5.4 nomenclature; it's called Linked Repository in 5.5).

You can convert your existing repository to shared by going to it's configuration and clicking on 'Convert to shared repository' link. (you need to be Bamboo admin for this)

Please note that checkout task in Deployment project always updates to the tip of the git branch.

For us it is a big deal and the main reason we are not using Deployment projects that the Sourcecode Checkout task is not checking out the same exact code that triggered the deplyment build. It is not nice to make artifacts with sourcecode/scripts when it's available in the Sourcecode system. They should be retrieved from there, i don't understand why Atlassian has not added this simple feature that the user can specify which revision to checkout.

If don't require the entire repository, I would suggest you tag the script(s) as an artifact on the build side, then your deployment project will be able to use each time.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

201 views 4 1
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