Improve circleci config file

This commit is contained in:
Tobie Morgan Hitchcock 2017-11-16 20:21:55 +00:00
parent e300e9c423
commit 1fdfb2c58a

View file

@ -2,19 +2,21 @@ version: 2
jobs: jobs:
build: build:
docker: docker:
- image: abcum/circle:0.1.1 - image: abcum/circle-golang:latest
environment:
GOOGLE_APPLICATION_CREDENTIALS: /root/gcloud-service-key.json
working_directory: /go/src/github.com/abcum/surreal working_directory: /go/src/github.com/abcum/surreal
steps: steps:
- checkout - checkout
- run:
name: Auth
command: gcauth
- run: - run:
name: Clean name: Clean
command: make clean command: make clean
- run: - run:
name: Glide name: Setup
command: make glide command: make setup
- run:
name: Patch
command: make patch
- run: - run:
name: Tests name: Tests
command: make tests command: make tests
@ -25,6 +27,11 @@ jobs:
- run: - run:
name: Deploy name: Deploy
command: | command: |
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker build -t abcum/surreal . docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push abcum/surreal docker build -t abcum/surreal .
docker push abcum/surreal
gcloud docker -- build -t abcum/surreal .
gcloud docker -- tag abcum/surreal:latest eu.gcr.io/abcum-ltd/surreal:latest
gcloud docker -- push eu.gcr.io/abcum-ltd/surreal:latest
fi