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

Block build if child builds are queued or in progress

Magnus Heino December 19, 2012

I know about the "Block build if parent builds are queued or in progress" dependency blocking strategies.

I would like a "Block build if child builds are queued or in progress" strategy. Is that possible to achieve?

We have a system that is made up of modules. Each module has a build plan. Every hour, a deployment plan takes all the latest modules, and deploys them on a server. That plan triggers a bunch of selenium system test child plans. These plans take some time to execute. Is it possible to somehow block the "deployment plan" from redeploying while there are triggered system test child plans that are still running?

1 answer

0 votes
Cameron Ferguson
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.
December 19, 2012

I don't think there is a built in way of doing this... but nothing says you can't get really creative with some odd-ball approach to achieve this :)

A possible solution would be to create a single agent that both parent and child plans rely on that gets tied up while the build is in progress, therefore not allowing one to start while the other is building.

Another solution would be to set up some script/program that queried Bamboo with the Atlassian Command Line Interface to see if that particular task was running.

bamboo --action getPlan --server http://localbambooserver:1234 --user bamboo_admin --password bamboo_admin_password --plan PROJECTKEY-PLANKEY

This will spit out something to the affect of

Key . . . . . . . . . . . . . : PROJECTKEY-PLANKEY
Name . . . . . . . . . . . . : Project Key - Plan Name
Description . . . . . . . . . : Plan Description
Short key . . . . . . . . . . : PLANKEY
Short name . . . . . . . . . : Plan Name
Enabled . . . . . . . . . . . : true
Is active . . . . . . . . . . : true
Is building . . . . . . . . . : true
Is favourite . . . . . . . . : false
Average build time (seconds) : 265.0
Link . . . . . . . . . . . . : http://localbambooserver:1234/rest/api/latest/plan/PROJECTKEY-PLANKEY

Then you can parse out the "Is Building" line to see if it's "true" or "false". Just test this every 10-15 seconds or so in a script until it's no longer building, then continue on with the rest of the build.

A little bit of a messy approach, but it'll work :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events