Schedule customised build

I have a build plan in Bamboo to build a project. The build uses a script which require 3 parameters. These are configured as variables and I can set them by Run > Run Customised.

I need to set up a cron job to build several version of this project. Is there a way to provide these parameters somehow in a scheduled job?

Also, would it be possible to save popular configurations so they can be re-run easily without having to provide the parameters each time? Even if that would require some other scripting or calling a bamboo url directly. 

2 answers

1 accepted

You can use the "Inject Bamboo variables" Task for this.

Let the cron job start a script that generates a file with the proper key=value pairs, and then starts the Bamboo build through REST.
The "Inject Bamboo variables" Task uses the generated file.
Note that the variables read from the file will be in their own namespace, e.g. ${bamboo_namespace_myvar} instead of just ${bamboo_myvar}. 

Alternatively you can override variables in the REST call itself, as described in the Resetting Variables via a REST API call and Dynamic Release versioning Knowledge Base article.

 

I think I can do what I want with the REST call. thanks!

Create a new branch plan and set its repository path to your original one (so it will use the same sources). In a branch override variables you need.

Then you can add scheduled builds and so on.

At the moment I have 11 x 3 x 2 possible configurations. One branch for each is not really feasible. This is really what I wanted to avoid by using variables in the first place. But thanks for the suggestion.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
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,813 views 0 6
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