Installing GoCD agent on Linux
The GoCD agent RPM installer has been tested on RedHat Enterprise Linux and CentOS. It should work on most RPM based Linux distributions.
If you prefer to use the YUM repository and install via YUM, paste the following in your shell -
Once you have the repository setup, execute
sudo yum install -y go-agent
Alternatively, if you have the agent RPM downloaded:
Debian based distributions (ie Ubuntu)
The GoCD agent .deb installer has been tested on Ubuntu. However it should work on most Linux distributions which use debs.
echo "deb https://download.gocd.org /" | sudo tee /etc/apt/sources.list.d/gocd.list
curl https://download.gocd.org/GOCD-GPG-KEY.asc | sudo apt-key add -
Once you have the repository setup, execute
Alternatively, if you have the agent DEB downloaded:
To run GoCD on container please use our official
For installing GoCD agent using rpm/deb packages on containers, starting from release 19.7.0 the following additional dependencies will be required.
On Fedora, install procps
package, execute
sudo yum install sysvinit-tools
Managing the GoCD agent process
The GoCD agent script must be run with one of the following arguments:
utilizes the service manager (e.g systemd, upstart, init.d) used by your OS.
The GoCD agent installs its files in the following locations on your filesystem:
Location | Description |
---|---|
/var/lib/go-agent | the GoCD agent configuration and working directory |
/var/log/go-agent | the GoCD agent log files |
/usr/share/go-agent | the GoCD agent binaries and startup scripts |
/usr/share/go-agent/wrapper-config/wrapper-properties.conf | the configuration file to alter GoCD agent properties |
Configuring the GoCD agent
After installing the GoCD agent, you must first configure the agent with the hostname (or IP address) of your GoCD server, in order to do this:
- Open in your favourite text editor.
- Follow the instructions in the file to configure the GoCD server url
- Save the file and exit your editor.
- Run
service go-agent [start|restart]
to (re)start the agent.
For security reasons, all newly installed GoCD agents need to be enabled on the GoCD server before work is assigned to them. This prevents an unauthorized person from getting access to your source code. To enable a newly installed GoCD agent, do the following:
- Follow the instructions here to find the agent you’ve just installed on the list and add the agent to your cloud. The GoCD server will now schedule work for this agent.