Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Bamboo to use specific Build Agent for Deployment

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?

like image 363
Sakamoto Kazuma Avatar asked Aug 16 '13 13:08

Sakamoto Kazuma


People also ask

How do I deploy a previous build in bamboo?

To manually start a deployment:Using the radio buttons, decide if you wish to create a new release from a build result or promote an existing release to the deployment environment. If creating a new release from a build result: Select Create new release from build result. Select the Plan branch you wish to use.

What is remote agent in bamboo?

Description. A Bamboo Agent is a service that provides capabilities to run job builds. There are two types of Bamboo Agents – Local Agents actually run as part of the Bamboo server, and Remote Agents run on computers, other than the Bamboo server, that run the Remote Agent tool.


2 Answers

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.

like image 116
Brett Bim Avatar answered Nov 02 '22 23:11

Brett Bim


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.

like image 40
Paul G Avatar answered Nov 03 '22 00:11

Paul G