2017-03-28 11:12:00 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2017-11-16 20:21:55 +00:00
|
|
|
- image: abcum/circle-golang:latest
|
|
|
|
environment:
|
|
|
|
GOOGLE_APPLICATION_CREDENTIALS: /root/gcloud-service-key.json
|
2017-03-28 11:12:00 +00:00
|
|
|
working_directory: /go/src/github.com/abcum/surreal
|
|
|
|
steps:
|
|
|
|
- checkout
|
2017-11-16 20:21:55 +00:00
|
|
|
- run:
|
|
|
|
name: Auth
|
|
|
|
command: gcauth
|
2017-03-28 11:12:00 +00:00
|
|
|
- run:
|
|
|
|
name: Clean
|
|
|
|
command: make clean
|
|
|
|
- run:
|
2017-11-16 20:21:55 +00:00
|
|
|
name: Setup
|
|
|
|
command: make setup
|
2017-03-28 11:12:00 +00:00
|
|
|
- run:
|
|
|
|
name: Tests
|
|
|
|
command: make tests
|
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: make build
|
|
|
|
- setup_remote_docker
|
|
|
|
- run:
|
|
|
|
name: Deploy
|
|
|
|
command: |
|
2017-11-16 20:21:55 +00:00
|
|
|
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
|
|
|
docker login -u $DOCKER_USER -p $DOCKER_PASS
|
2018-11-29 13:06:54 +00:00
|
|
|
docker build -t surreal/surreal .
|
|
|
|
docker push surreal/surreal
|
|
|
|
gcloud docker -- build -t surreal/surreal .
|
|
|
|
gcloud docker -- tag surreal/surreal:latest eu.gcr.io/surreal-io/surreal:latest
|
2018-11-29 12:45:56 +00:00
|
|
|
gcloud docker -- push eu.gcr.io/surreal-io/surreal:latest
|
2017-11-16 20:21:55 +00:00
|
|
|
fi
|