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
Community showcase
Asked Thursday in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

490 views 2 5
View question

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