Force Bamboo to use specific Build Agent for Deployment
Asked Answered
F

2

7

I am using bamboo to do a build, as well as a deploy on a linux machine (ubuntu). I also have a build plan using a remote agent on Windows 7 64-bit.

I'm noticing that Bamboo wants to try and use the remote agent(windows7) to deploy the linux build at times. How do I prevent this?

I see that I can set Agents in the Deployment Plan Editing screens, but that would require one linux agent to build, and one linux agent to deploy. Is it possible to use the same linux agent to build and deploy while ensuring that deployment is ALWAYS using the linux agent instead of any other available non-linux Agent?

Fakery answered 16/8, 2013 at 13:51 Comment(0)
P
7

The closest thing that we've been doing is adding a required capability to particular agents that other agents don't have. So on the linux agent, define a custom capability for that agent. Then in the Requirements for the deploy, include that custom capability. This should prevent the Windows remote agent from picking up that job.

Pennypennyaliner answered 11/9, 2013 at 23:5 Comment(3)
HOW? How are you doing this "in the Requirements for the deploy, include that custom capability", exactly? I have some agents with custom capabilities, but cannot find how to do what you're saying?Val
We aren't using the actual deployment projects from Bamboo, just a regular build definition. Go to the linux agent page and define a "CanBuildLinux" capability and set it to true. Then on your build configuration -> Default Job -> Requirements tab, create "CanBuildLinux" equals true. Now only the agents that have that capability will be able to run that build.Pennypennyaliner
Brett Bim sigh :) I thought you're using the Deployment Project and somehow found a magical option that I overlooked after 3 hours of clicking every single link in that UI :) Thanks for the response and putting my mind at ease that it's actually impossible with Deployment Projects ;)Val
I
1

I don't think there is any application functionality available to do what you are trying to do, apart from dedicating an agent(s) to only be available to handle designated deployment projects.

However, one workaround that seems to accomplish the same goal is to include a dummy step in your tasks that does nothing but would cause Bamboo to send it to a certain group of agents.

For example, I have the opposite problem where I need my deploy to run on a Windows box and not a Linux box. I include an MSBuild task with /? for the solution name, which causes Bamboo to send the deploy to only Windows servers, but the task actually does nothing but print the MSBuild command options in the log.

I'm sure you could find something similar for Linux. Also, I think you could specify a custom executable using the Command task type. If you define that command with a path and make sure it exists on the machines you want to target, you may be able to achieve the desired result. The actual executable could just be a script that does nothing.

Isochromatic answered 30/4, 2015 at 21:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.