-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
35 lines (32 loc) · 1.37 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
machine:
environment:
PROJECT_NAME: gophish-150317
CONTAINER_NAME: gophish
CLUSTER_NAME: gophish-cluster
CLOUDSDK_COMPUTE_ZONE: asia-east1-a
services:
- docker
dependencies:
pre:
- chmod +x ./deploy.sh
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update kubectl
- echo ${GCLOUD_SERVICE_KEY} | base64 --decode -i > ${HOME}/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
- docker build -t asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:$CIRCLE_SHA1 .
- docker tag asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:$CIRCLE_SHA1 asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:latest
test:
post:
- docker run -d -p 3333:3333 --name gophish asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:latest; sleep 10
- curl --retry 10 --retry-delay 5 -v http://localhost:3333
deployment:
prod:
branch: master
commands:
- ./deploy.sh
release:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- ./deploy.sh