Can a Release be created programatically

We a have a special "Release Build Plan" that produces the artifacts and tags the release in the VCS. This is a manually invoked plan as it requires a release identifier as custom input.

However, this plan still doesn't create a Release in Bamboo instead we still have to go in and manually create a Release that associates the outputs (artifacts) of that build with a Release.

Can this be automated in some fashion, prefereably as the last task of our "Release Build Plan"?

5 answers

1 accepted

0 votes
Accepted answer

You can configure release naming in Deployment Project configuration. It is possible to use variables inside release names.

I thought so - but I am not sure that matches our needs. Our release name is set as part of the Release Build Plan as it goes into the VCS tag, as well as certain manifest files are updated based on it which then embeds it into the artifacts (jar files) generated and so on. So it has to "somehow flow" from the Release Build Plan into the trigger for the dummy deployment build. Is there a way of doing that, e.g. can the Release Build Plan set a global variable that we can then reference in the Deployment Project Release naming configuration?

Thanks for listening.

> This is a manually invoked plan as it requires a release identifier as custom input.

Reading this I was under impression that you use "Run customised..." and define release name as a variable there. If that's the case then it should work 'out of the box', just use the same variable name for Release name in Deployment Project.

All the variables' values (including manually defined ones) are saved & passed to the Deployment when you create a new release from a build result.

> All the variables' values (including manually defined ones) are saved & passed to the Deployment when you create a new release from a build result.

I wasn't aware off this - thanks a lot

1 vote

ATM The solution to this is hacky but possible. You can do this in the following way:

- In your Deployment Project create a dummy environement. Remove the default task (you won't need them) and add a simple Script Task that does nothing (exit 0 will do)

- Configure After Successful Plan trigger in your dummy Environment.

If you do this, every time the Release Build Plan ends sucessfully (including all the manual stages if you have those), the trigger will pick up the build result, create a release and launch the dummy environment.

Thanks for the prompt response. I will give this a go. When a Deployment Plan is triggered like this and creates a release automatically how does it decide on the Release Identifier to use?

What about if you want this to happen for all branches of a plan? This option only lets you configure one branch to deploy to your dummy environment.

<3 you Atlassian Products!

Yes, this triggered deployment approach works - to an extent. However, if you want to create releases from a branch, you are stuck with the default versioning scheme - as far as I can work out.

I fully agree with Mark, being "stuck" is absolutely correct. Why was releasing from branches not (and why can it not be) created with flexibility in the versioning scheme?

Is it possible to auto-create a release from a new branch with this approach? I am trying and failing. I want Bamboo to auto-create a release when a new branch appears at a certain path in Subversion.

I'm automatically creating releases on successful branch builds, as well as on the default branch. The deployment project that initiates the auto-release needs multiple triggers to handle this. I have had to manually define this trigger after the branch is created, though - so it may not work for you if you want it to be fully automatic.

Indeed, I would like a release to be auto-created when a new branch is committed into .../tags directory. Too bad this is impossible as of now.

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

62 views 3 2
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