How to prevent deployment plans to run on certain agents?

The relationship between build plans and agents can be managed through capabilities and fine tuned using custom capabilities. These features don't seem to exist for deployment plans.

We have Linux and Windows based agents for building. However, for deployment we want to only use the Linux based agents. How can we prevent deployment plans to run on the Windows based agents? And no - dedicating agents just to deployment plans is not feasible. The Linux agents must stay available for running build plans.

6 answers

1 accepted

This widget could not be displayed.

You should be able to define a capability - a custom executable that exists only on the linux agents. This can be as simple as a shell script that does nothing. Just make sure that it exists in the same path and is executable (which may or may not truly be necessary but seems like it would throw an error if the script wasn't executable). I have a batch file on my local agents that prints the current date to the screen to restrict the build to a local agent (deployment plans should not be any different as you just insert a new task that uses the shell script). If the shell script exists on the server it will be available as meeting the requirements of the deployment plan. You'll need to add it into each stage though. A stage will revert to the next available agent even if the first stage is restricted via capabilities.

got it - bit clunky but workable

Thanks

We're also doing this. Need to be able to specify requirements on Deployment plans.

This widget could not be displayed.

see Requirement for Deployments

This plugin fixes the issue.

This widget could not be displayed.
Timothy Chin Community Champion Nov 07, 2013

Create a custom requrirement on the agent that you want to restrict it too. I can be anything that you want to define (e.g. the name of the build project).

Then for each job, add that custom requirement to it to force it to use that agent only.

This widget could not be displayed.

If I may jump in...I would say this isn't a scalable solution, especially when you have over 100 deployment projects with multiple environments in each.

In our case, all of our agents are linux servers, with the exception of a mac mini that is designated for ios builds. I've been trying to figure out how to make sure deployments aren't run from the mac mini. Adding a dummy executable task to all of our deployment projects would be a headache. Is there any talk about adding the capability to exclude specific agents from being used as deployment servers?

I fully agree with your sentiments. The problem as I see it is that Deployment Plans are currrently gimped versions of Build Plans and lack some of the important features of Build Plans like stages and jobs and custom capabilities. For example for us a full deployment means updating a mix of environments (Windows and Linux) but a Deployment Plan can't deliver that as it has no stages that can run on different agents depending on capabilities. Build Plans can do that but Deployment Plans can't. I have no idea why Atlassian didn't make the full power of Build Plans available for Deployment Plans as obviously the infrastructure is already in place.

This widget could not be displayed.

Actually, I just tried what Gretchen suggested and it still doesn't work.

@ Manuel - were you able to get the workaround to work as mentioned by Gretchen?

Here's what I did:

1) Added new executable capability (points to a dummy script) to the agents I want deployments to run on.

2) Added a Command task to a deployment project stage to run the newly-defined custom executable.

...and Bamboo is still showing all agents as capable of running the deployment. Hm...? I've confirmed the one agent I don't want deployments running on doesn't have the executable capability. I've also run the deployment just to see if it uses the excluded agent, and it did after a couple runs.

Any thoughts?

@Gretchen, am I missing something?

Nope, this is a bogus solution. It does not restrict what agents a deployment can run on, it just makes the deployment fail on certain agents.

Actually it might work in certain Bamboo versions. But the latest as of this writing gives you a better solution, using capabilities directly.

This widget could not be displayed.

Same as Joe, I can exert no influence on the choice of agent for the deployment project, despite independently trying same.

Added comments to https://jira.atlassian.com/browse/BAM-13631

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...

143 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