GoCD Setup Using Docker Compose

This repository uses docker-compose to setup a testing environment with one GoCD server and 3 GoCD agents

First time setup

Starting docker-compose

git submodule update --init
docker-compose up -d

The docker-compose file contains one server and three agents:

Note:

  • The server and agents will take a while to initialize and startup correctly. GoCD agents will automatically register with GoCD server (however agents need to be enabled from server UI before they can be used for any pipeline).
  • GoCD server can be accessed through: http://localhost:8153
  • Local git server can be accessed through: http://localhost:3000
  • This is NOT production setup

Setting up local Git server (gogs)

  • Open local git server at http://localhost:3000

  • Click Register, fill in information to create an admin account, .e.g.

    Username: gogs
    Email: gogs@email.com
    Password: password.123
    
  • Log in

Gogs utilities scripts

If you prefer command-line over Gogs UI, there are several shell scripts in scripts folder to automate the most common operations with Gogs:

  • ./scripts/generate-token.sh: this will create an access token with name default-access-token in Gogs to perform operations using Gogs REST API. This script is used internally by the 2 scripts below.
  • ./scripts/create-git-repo.sh some-repo: create git repo in Gogs
  • ./scripts/upload-public-key.sh: upload your default public key at ~/.ssh/id_rsa.pub to Gogs server. This is so that you can push to Gogs from your host machine using SSH.

These scripts assume following tools are available in your system: