Can a Release be created programatically

Manuel Mall October 22, 2013

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
Answer accepted
Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2013

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

Manuel Mall October 23, 2013

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.

Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 24, 2013

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

Manuel Mall October 24, 2013

> 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

2 votes
Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2013

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.

Manuel Mall October 23, 2013

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?

Joseph Strauss February 10, 2016

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.

0 votes
Ron Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2014

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?

Dimitri Tischenko April 10, 2014

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.

Mark Brodziak April 13, 2014

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.

Dimitri Tischenko April 13, 2014

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.

0 votes
Mark Brodziak April 3, 2014

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.

0 votes
Alex Endfinger October 24, 2013

<3 you Atlassian Products!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events