-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
56 lines (48 loc) · 1.5 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
machine:
environment:
PATH: $PATH:node_modules/.bin
EXTERNAL_REGISTRY_BASE_DOMAIN: quay.io/cloudytimemachine
REPOSITORY_NAME: worker-screenshot
REGISTRY_EMAIL: none
CI_SHA1: $CIRCLE_SHA1
CI_BRANCH: $CIRCLE_BRANCH
CI_BUILD_NUM: $CIRCLE_BUILD_NUM
KUBECONTEXTQA: ctm-staging
KUBECONTEXTPROD: ctm-prod
node:
version: v4
services:
- docker
- redis
dependencies:
pre:
- if [[ -z $CIRCLE_TAG ]] ; then echo $GCLOUD_KEYDATA | base64 --decode > ./gcloud_key.json; exit $?; fi
- if [[ -z $CIRCLE_TAG ]] ; then npm install; exit $?; fi
- if [[ -z $CIRCLE_TAG ]] ; then docker login -e [email protected] -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD quay.io; exit $?; fi
- if [[ -z $CIRCLE_TAG ]] ; then docker-build -f deploy/common.config; exit $?; fi
override:
- echo "overriding inferred dependencies"
database:
override:
- echo "overriding inferred dependencies"
test:
override:
- if [[ -z $CIRCLE_TAG ]] ; then npm run test-circleci; exit $?; fi
deployment:
staging:
branch: master
owner: cloudytimemachine
commands:
- docker-push -f deploy/common.config
- ensure-kubectl
- prepare-kubectl
- kubectl config use-context ${KUBECONTEXTQA}
- k8s-deploy -f deploy/staging.config
production:
tag: /v[0-9]+(\.[0-9]+)*/
owner: cloudytimemachine
commands:
- ensure-kubectl
- prepare-kubectl
- kubectl config use-context ${KUBECONTEXTPROD}
- k8s-deploy -f deploy/production.config