/
config.yml
58 lines (58 loc) · 1.62 KB
/
config.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
version: 2.0
workflows:
version: 2
build_test_deploy:
jobs:
- test
# Uncomment this to deploy to Kubernetes on each push
# - build_docker
# - deploy_to_k8s:
# requires:
# - test
# - build_docker
jobs:
test:
docker:
- image: circleci/node:9
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm test
- run: npm run test:coverage
- run: npm run doc:generate
- store_artifacts:
path: ~/repo/coverage
destination: coverage
- store_artifacts:
path: ~/repo/apiDoc
destination: apiDoc
build_docker:
docker:
- image: docker:stable-git
working_directory: ~/repo
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run: docker login $DOCKER_REGISTRY -u $DOCKER_USER -p $DOCKER_PASSWORD
- run: docker build . -t $DOCKER_REGISTRY/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1
- run: docker push $DOCKER_REGISTRY/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1
deploy_to_k8s:
docker:
- image: quay.io/roboll/helmfile:v0.16.0
working_directory: ~/repo
steps:
- checkout
- run: mkdir -p $HOME/.kube
- run: echo $KUBE_CONFIG > $HOME/.kube/config
- run: helm init --client-only
- run: helmfile sync