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?
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.