Block build if child builds are queued or in progress

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

This widget could not be displayed.

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
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

201 views 1 3
Join discussion

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