How to prevent deployment plans to run on certain agents?

Manuel Mall November 7, 2013

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

0 votes
Answer accepted
Gretchen
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.
November 13, 2013

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.

Manuel Mall November 15, 2013

got it - bit clunky but workable

Thanks

Swift Capital December 23, 2014

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

1 vote
Raj Prasad January 8, 2015

see Requirement for Deployments

This plugin fixes the issue.

0 votes
David Armitage February 17, 2014

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

0 votes
Joe Levis November 24, 2013

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?

ErbC October 14, 2016

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.

ErbC October 14, 2016

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

0 votes
Joe Levis November 20, 2013

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?

Manuel Mall November 20, 2013

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.

0 votes
Timothy
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.
November 7, 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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events