-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
config.yml
77 lines (71 loc) · 2.29 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: 2.1
orbs:
docker: circleci/docker@0.5.1
aws-eks: circleci/aws-eks@0.2.7
workflows:
build_test_deploy:
jobs:
- build_test
# push new Docker image to Docker Hub
- docker/publish:
image: operationcode/resources-api
tag: latest
after_build:
- run:
name: Tag and Push with $CIRCLE_SHA1
command: |
IMAGE_ID=operationcode/resources-api
docker tag ${IMAGE_ID}:latest ${IMAGE_ID}:${CIRCLE_SHA1}
docker push ${IMAGE_ID}:${CIRCLE_SHA1}
requires:
- build_test
filters:
branches:
only:
- main
# Deploy the new docker image to the AWS EKS cluster, staging namespace
- aws-eks/update-container-image:
container-image-updates: 'app=operationcode/resources-api:${CIRCLE_SHA1}'
cluster-name: 'operationcode-backend'
namespace: 'operationcode-staging'
resource-name: 'deployment/resources-api'
get-rollout-status: true
watch-rollout-status: true
watch-timeout: 5m
record: true
requires:
- docker/publish
filters:
branches:
only:
- main
jobs:
build_test:
machine:
image: ubuntu-1604:201903-01
environment:
CC_TEST_REPORTER_ID: 08bad9e4f229f88064fd6ee1c0fe4f64be37943beff36f37f8b8896123ef6752
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run:
name: Initializing CodeClimate
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /usr/local/bin/cc-test-reporter
chmod +x /usr/local/bin/cc-test-reporter
/usr/local/bin/cc-test-reporter before-build
- run: sudo chown -R 5000 .
- run:
name: Run tests
command: |
make test
- run:
name: Run linting and coverage
command: |
make lint
docker-compose run resources-api coverage xml
/usr/local/bin/cc-test-reporter after-build
- run:
name: Run Bandit security analysis
command: |
make bandit