Install teamcity agent on ubuntu 18.04

Install teamcity agent on ubuntu 18.04

In this, we will learn how to install teamcity agent 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 18.04

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

Read Also: Install teamcity agent on Ubuntu 16.04

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 documentation

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

Your email address will not be published.


*