Skip to content

Instantly share code, notes, and snippets.

@philwebb
Last active April 10, 2017 13:09
Show Gist options
  • Save philwebb/00259bd7afcaa042a74dcc3864806078 to your computer and use it in GitHub Desktop.
Save philwebb/00259bd7afcaa042a74dcc3864806078 to your computer and use it in GitHub Desktop.

Getting started with Concourse/ATC

Checkout the code

You need to checkout the concourse project, atc will be picked up as a submodule. The develop branch is for active work:

$ git clone https://github.com/concourse/concourse
git checkout develop
git submodule update --init --recursive

Install development tools

Consourse is built with Go and Elm. You also need Node and few modules. Assuming you’re using a mac:

Then use homebew to install the following:

brew install go
brew install node
brew install bzr
brew install postgres

Finally use Node to install the javascript toos:

npm install uglify-js -g
npm install -g less
npm install -g less-plugin-clean-css

Setting up the database

You need a running postgres database named atc. The application takes care of creating and upgrading the schema so it can be empty. If it’s the first time you’ve install postgress you need to run initdb

initdb /usr/local/var/postgres -E utf8

After that you can start the server and create the empty atc database:

postgres -D /usr/local/var/postgres/
createdb atc

Building and running the code

To configure your GOPATH make sure you are in the root concourse checkout directory and run:

source .envrc
Note
You need to be in the correct directory. Don’t run source .envrc from a different location.

To build the web code:

cd src/github.com/concourse/atc/web
make -B

Finally you can run the application:

cd ..
go run cmd/atc/*.go -d

Concouse should be live at http://localhost:8080

Building the fly command line tool

If you try to use a realse version of fly you will get errors like this:

fly -t local ps
targeting http://localhost:8080

error: strconv.ParseInt: parsing "0-dev": invalid syntax

To work around that you need to build a local copy and use that instead

cd ${concourse}/src/github.com/concourse/fly
go build -o fly main.go
alias fly=${concourse}/src/github.com/concourse/fly/fly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment