-
Notifications
You must be signed in to change notification settings - Fork 10
Remote Agents
Remote agents work with the bamboozled-ruby-plugin. This plugin adds both the ruby and xvfb-run capability types. While auto-detection of these capabilities is the default on the remote agent, you may choose to setup shared capabilities manually as well.
This guide assumes the bamboo agent home directory to be /apps/bamboo-agent and the master server url to be http://bamboo.acme.com/agentServer/
mkdir -p /apps/bamboo-agent/bin
cd /apps/bamboo-agent/bin
wget http://bamboo.acme.com/agentServer/agentInstaller/atlassian-bamboo-agent-installer-5.9.3.jarjava -Dbamboo.home=/apps/bamboo-agent -jar /apps/bamboo-agent/bin/atlassian-bamboo-agent-installer-5.9.3.jar http://bamboo.acme.com/agentServer/
# allow to start
# CTRL-C vi /etc/systemd/system/bamboo-agent.serviceContents (be sure to adjust paths and user/group):
[Unit]
Description=Atlassian Bamboo Agent
After=syslog.target network.target
[Service]
Type=forking
User=apps
Group=apps
ExecStart=/apps/bamboo-agent/bin/bamboo-agent.sh start
ExecStop=/apps/bamboo-agent/bin/bamboo-agent.sh stop
[Install]
WantedBy=multi-user.targetThen reload and start it (as root or using sudo)
systemctl daemon-reload
systemctl start bamboo-agentsudo ln -s /apps/bamboo-agent/bin/bamboo-agent.sh /etc/init.d/bamboo-agent
sudo update-rc.d bamboo-agent defaultsOnce the agent is online, you will have to approve access to it on the Agents page. If the agent has DHCP, you may want to edit the IP address and approve the subnet i.e. change 10.1.10.22 to 10.1.10.*.
Upon approval, the agent should be visible with a link in the Online Remote Agents section. If it is not, make sure that you are allowing the broker url to connect. This may require opening a port. For the uncomplicated firewall, the command to open the default port is sudo ufw allow 54663/tcp
As of 5.9.3, the remote agent's bamboo-agent.sh has a bug in the shell script (which was fixed by the original vendor over 2 years ago). This will usually manifest with a complaint about a missing environment variable such as HOME in rspec:
WARNING: Unable to find ~/.rspec because the HOME environment variable is not set.This has been reported as BAM-16205. The workaround is to edit the bamboo-agent.sh and change su -m $RUN_AS_USER to su - $RUN_AS_USER.
I've found that if I add a new RVM gemset, capabilities will only show up if I restart the bamboo agent. It may have a re-detection time, but it is quick and easy to restart with sudo service bamboo-agent restart. New capabilities will show up immediately after the restart.
If the Online Remote Agents tab has only log statements like A remote agent is loading on xyz (127.0.0.1), your broker url may be connected. If you are using ufw, open the port with sudo ufw allow 54663/tcp. See open ports with sudo ufw status