Install teamcity agent on ubuntu 16.04/ centos 7
This is part 3 of teamcity tutorial. In this, we will learn how to install teamcity agents on Ubuntu. There are two ways to install agents for teamcity. I will show you the zip method. In this method, we will download the zip file from teamcity server. So, let’s get started.
Prerequisites for teamcity agent
- Java 8 must be installed
- Ubuntu or centos 7 must be installed
Part 1: How to install teamcity 10.x on Ubuntu 16.04
Part 2: How to install teamcity 10.x on centos 7
Install teamcity agent
Firstly, we will create a directory for installation.
sudo mkdir /opt/teamcity
cd /opt/teamcity
Download the zip file distribution
We need to download a zip file from the teamcity server to install it on the agent. Replace the server-url with your server ip or server hostname.
wget http://server-ip:8111/update/buildAgent.zip
sudo unzip buildAgent.zip
sudo chmod +x bin/agent.sh
cp conf/buildAgent.dist.properties conf/buildAgent.properties
Now we need to open the buildAgent.properties
file and change the serverUrl
with your server URL on line 9.
Teamcity agent startup script
Now we will create teamcity agent startup script so that we can manage it easily.
sudo vim /etc/systemd/system/teamcity-agent.service
[Unit]
Description=TeamCity Build Agent
After=network.target
[Service]
Type=forking
PIDFile=/opt/teamcity/logs/buildAgent.pid
ExecStart=/opt/teamcity/bin/agent.sh start
ExecStop=/opt/teamcity/bin/agent.sh stop
[Install]
WantedBy=multi-user.target
Start teamcity-agent Services
Now we have created service file let’s enable and start the services of teamcity-agent.
systemctl enable teamcity-agent
systemctl start teamcity-agent
Now our teamcity agent is started and you can go to teamcity server and use the agent for builds.
Source: TeamCity documentaion
If you got any issues installing teamcity agent please feel free to comment below.
Read Also: How to install bucardo for postgresql replication
Leave a Reply