Skip to content

Commit 56a8175

Browse files
authored
Merge pull request #348 from OperationCode/deploy-main-to-staging
CircleCI: automatically deploy main branch to staging on every merge
2 parents 839ae72 + 7d31f5a commit 56a8175

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

.circleci/config.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: 2.1
22

33
orbs:
44
docker: circleci/docker@0.5.1
5+
aws-eks: circleci/aws-eks@0.2.7
56

67
workflows:
78
build_test_deploy:
@@ -26,42 +27,50 @@ workflows:
2627
only:
2728
- main
2829

30+
# Deploy the new docker image to the AWS EKS cluster, staging namespace
31+
- aws-eks/update-container-image:
32+
container-image-updates: 'app=operationcode/resources-api:${CIRCLE_BUILD_NUM}'
33+
cluster-name: 'operationcode-backend'
34+
namespace: 'operationcode-staging'
35+
resource-name: 'deployment/resources-api'
36+
get-rollout-status: true
37+
watch-rollout-status: true
38+
watch-timeout: 5m
39+
record: true
40+
requires:
41+
- docker/publish
42+
filters:
43+
branches:
44+
only:
45+
- main
46+
2947
jobs:
3048
build_test:
31-
3249
machine:
3350
image: ubuntu-1604:201903-01
34-
3551
environment:
3652
CC_TEST_REPORTER_ID: 08bad9e4f229f88064fd6ee1c0fe4f64be37943beff36f37f8b8896123ef6752
3753

3854
steps:
39-
4055
- checkout
41-
4256
- run: sudo chown -R circleci:circleci /usr/local/bin
43-
4457
- run:
4558
name: Initializing CodeClimate
4659
command: |
4760
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /usr/local/bin/cc-test-reporter
4861
chmod +x /usr/local/bin/cc-test-reporter
4962
/usr/local/bin/cc-test-reporter before-build
50-
5163
- run:
5264
name: Run tests
5365
command: |
5466
make test
55-
56-
5767
- run:
5868
name: Run linting and coverage
5969
command: |
6070
make lint
6171
docker-compose run resources-api coverage xml
6272
/usr/local/bin/cc-test-reporter after-build
63-
6473
- run:
6574
name: Run Bandit security analysis
6675
command: |
67-
make bandit
76+
make bandit

0 commit comments

Comments
 (0)