Skip to content

Instantly share code, notes, and snippets.

@clementohNZ
Forked from kevin-smets/concourse.md
Created July 12, 2018 22:29
Show Gist options
  • Save clementohNZ/ce72b16f076ca2c152131f820911a658 to your computer and use it in GitHub Desktop.
Save clementohNZ/ce72b16f076ca2c152131f820911a658 to your computer and use it in GitHub Desktop.
Setup the Concourse binary locally on macOS and run the hello world example.

Prerequisites

  • Homebrew

Install Concourse

curl -Lo concourse https://github.com/concourse/concourse/releases/download/v2.2.1/concourse_darwin_amd64 && chmod +x concourse && sudo mv concourse /usr/local/bin

Install Postgres

brew install postgres

Check if everything is OK

concourse -v

# Server version
pg_config --version 

# Client version
psql --version

Init the db

initdb /usr/local/var/postgres

Optional: launch Postgres automatically at login

mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.5.4_1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Start the PostgreSQL server manually

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

Setup the necessary users, roles and dbs

psql -h localhost -U postgres
CREATE ROLE concourse superuser;
CREATE DATABASE atc;
CREATE DATABASE concourse;
ALTER USER concourse WITH PASSWORD 'concourse';
\q

Generate the necessary keys for Concourse

Do this in an empty folder somewhere, you'll need to launch Concourse from this location. The commands are copied from https://concourse.ci/binaries.html

ssh-keygen -t rsa -f host_key -N '' && ssh-keygen -t rsa -f worker_key -N '' && ssh-keygen -t rsa -f session_signing_key -N ''
cp worker_key.pub authorized_worker_keys

Start the web overview

concourse web \
  --basic-auth-username concourse \
  --basic-auth-password concourse \
  --session-signing-key session_signing_key \
  --tsa-host-key host_key \
  --tsa-authorized-keys authorized_worker_keys \
  --external-url http://my-ci.example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment