From 1fdfb2c58ac860b378dbb028fc0b1f5d1be9a37d Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 16 Nov 2017 20:21:55 +0000 Subject: [PATCH] Improve circleci config file --- .circleci/config.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 50c2d2a5..fecabb08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,19 +2,21 @@ version: 2 jobs: build: 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 steps: - checkout + - run: + name: Auth + command: gcauth - run: name: Clean command: make clean - run: - name: Glide - command: make glide - - run: - name: Patch - command: make patch + name: Setup + command: make setup - run: name: Tests command: make tests @@ -25,6 +27,11 @@ jobs: - run: name: Deploy command: | - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - docker build -t abcum/surreal . - docker push abcum/surreal + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u $DOCKER_USER -p $DOCKER_PASS + 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