Installing GoCD agent on Mac OS X

  • Download the Mac OS X installer for GoCD Agent from downloads page.

  • Unzip the installer in a directory of your choice. It creates a sub-directory with the name go-agent-${version}.

  • Mark the directory as not quarantined by Mac OS X so that it allows the GoCD Agent to be started:

    1. # Assuming, for example, that the directory is "go-agent-20.5.0".
    2. $ cd go-agent-20.5.0
    3. $ xattr -d -r com.apple.quarantine .
    4. xattr: [Errno 13] Permission denied: './jre/Contents/Home/lib/server/classes.jsa'
    5. xattr: [Errno 13] Permission denied: './jre/Contents/Home/legal/jdk.dynalink/dynalink.md'
    6. ... # These "Permission denied" warnings can be ignored.

Managing the GoCD agent process

The GoCD agent script must be run with one of the following arguments:

ScriptDescription
./bin/go-agent consoleThe GoCD agent will be started in the foreground
./bin/go-agent startThe GoCD agent will be started as a daemon in the background
./bin/go-agent stopThe GoCD agent will be stopped
./bin/go-agent restartThe GoCD agent will be restarted

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 ./wrapper-config/wrapper-properties.conf 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.

Registering your agent with the server

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:

  1. Open the GoCD server dashboard
  2. 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.