GO CD/CI Server / Agent Quick Install

From wiki.kungfootek.net
Revision as of 03:30, 15 February 2017 by Daniel Baker (talk | contribs) (→‎Installation of server and agents)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Installation of server and agents

IMPORTANT: Be sure to install Java *prior* to installing the GO agent or you will be playing hide-and-seek with your JAVA_HOME.


Create a file in '/etc/yum.repos.d/thoughtworks-go.repo' with the following contents.

Always get your repo data from the source. It's been known to change from time to time. 



yum -y install go-server
yum -y install go-agent

Repeat the go-agent install for every host you want to have access to, and on each host you will need to tell the Go-Agent where to find the Server:

For GO-Agent to work:

- Open /etc/default/go-agent in your favourite text editor.
- Change the line GO_SERVER= to the hostname (or IP address) of your Go server.
- Save the file and exit your editor.

To Start the Server and Agent:

systemctl start go-server
systemctl start go-agent

Start agent on every host you want to have access to.

Connect to the new GO server and click the agents tab to verify your agents are reporting in.


Secure your server

Using the htpasswd method will format the file correctly for you, and placement is arbitrary, though I would recommend a location that GO has access to.

In the Web UI:

Admin -> Server configuration -> 'Password File Settings'

Add the path and name of the file you created the password file with.

At the Server CLI

htpasswd -c -s /path/to/file/filename.ext YewzerName


Location of GO Server Files

It's easier to list some things here on one screen rather than wade through official docs:

/var/lib/go-server       #contains the binaries and database
/etc/go                  #contains the pipeline configuration files
/var/log/go-server       #contains the server logs
/usr/share/go-server     #contains the start script
/etc/default/go-server   #contains all the environment variables with default values. These variable values can be changed as per requirement.
/var/go/                 #Go server home folder. Also has .ssh folder and keys needed to check GIT Repos. Agents and the server will need ssh keys in Git to connect.

Location of GO Agent files

/var/lib/go-agent      #contains the binaries
/usr/share/go-agent    #contains the start script
/var/log/go-agent      #contains the agent logs
/etc/default/go-agent  #contains all the environment variables with default values. These variable values can be changed as per requirement


Most issues boil down to a mis-configured Java Home folder identified with the prominent note in /etc/default/go-(agent|server)


The easiest way I have found to fix this is:

yum remove -y go-(agent|server)
rm -rf /etc/default.go-agent.rpm(new|save)
yum remove java -y
yum update -y
yum install java -y
yum install go-(agent|server)

Should you get an error installing the GO agent via YUM make sure your Repo is up to date: [ https://docs.gocd.io/16.4.0/installation/install/agent/linux.html Where to get the latest repo data]

Check your /etc/default/go-(aggent|server) config files and make sure the server address is correct and start your services.

They make a big fuss about having a FQDN and GOCD will refuse to run unless it is convinced you have one. You don't need an official domain, just a little experience with your hosts file or custom DNS

In Centos 7 type hostnamectl and note the full hostname. Enter that into your hosts file ( /etc/hosts ) or into your custom DNS. If you don't like your hostname you can change with the command below. Just make sure your hosts file or DNS reflects the name you just set.

hostnamectl set-hostname <hostname>


Continuous Delivery with ThoughtWorks Go

Good Luck!