-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
58 lines (56 loc) · 2.32 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
machine:
node:
version: v6.1.0
services:
- redis
- docker
environment:
PROJECT_NAME: dynamic-sanctum-378
CLUSTER_NAME: portfolio
CLOUDSDK_COMPUTE_ZONE: us-east1-d
dependencies:
cache_directories:
- "app/node_modules"
override:
# Install NPM requirements
- cd app && npm install
# Install golang dependencies
- go get -t -d -v ./...
- go get github.com/golang/lint/golint
- go install github.com/golang/lint/golint
# Move to the $GOPATH directory.
- mkdir -p ~/.go_workspace/src/github.com/colin353/markdown.ninja
- cd ~/.go_workspace/src/github.com/colin353/markdown.ninja
# Delete any old, cached version of the code, if it exists.
- rm -rf ~/.go_workspace/src/github.com/colin353/markdown.ninja || true
- ln -s /home/ubuntu/markdown.ninja /home/ubuntu/.go_workspace/src/github.com/colin353/markdown.ninja
test:
override:
# Build all the binaries.
- ./etc/build.sh
# Check lint, flow, etc.
- ./etc/complain.sh
# Build the docker image.
- docker build --rm=false -t colinmerkel/portfolio:$CIRCLE_SHA1 .
# Start the docker image on the host.
- ./etc/integration.sh
deployment:
hub:
branch: master
commands:
# Save the image to docker hub.
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push colinmerkel/portfolio:$CIRCLE_SHA1
# Install kubernetes if necessary.
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update kubectl
# Create the authentication file, and use it to log into the cluster.
- echo $KUBE_AUTH | base64 --decode -i > ${HOME}/account-auth.json
- export GOOGLE_APPLICATION_CREDENTIALS=~/account-auth.json
- sudo /opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/account-auth.json
- sudo /opt/google-cloud-sdk/bin/gcloud config set project $PROJECT_NAME
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet config set container/cluster $CLUSTER_NAME
- sudo /opt/google-cloud-sdk/bin/gcloud config set compute/zone ${CLOUDSDK_COMPUTE_ZONE}
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet container clusters get-credentials $CLUSTER_NAME
# Deploy the image to the kubernetes cluster.
- ./kubernetes/deploy.sh