Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Schedule customised build

Dan Gustafsson July 22, 2015

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

0 votes
Answer accepted
rverschoor
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.
July 23, 2015

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.

 

Dan Gustafsson July 23, 2015

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

0 votes
Sergey Podobry _Stellarity Software_
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.
July 22, 2015

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.

Dan Gustafsson July 22, 2015

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
TAGS
AUG Leaders

Atlassian Community Events