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?

Jason Watts
  • 3,800
  • 29
  • 33
Sakamoto Kazuma
  • 2,573
  • 7
  • 34
  • 75

2 Answers2

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.

Brett Bim
  • 3,190
  • 4
  • 28
  • 26
  • 1
    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? – Strelok Aug 07 '14 at 05:00
  • 2
    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. – Brett Bim Aug 07 '14 at 13:39
  • 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 ;) – Strelok Aug 08 '14 at 06:05
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.

Paul G
  • 2,722
  • 4
  • 37
  • 54