Skip to content

Commit 829fa4d

Browse files
author
Aaron Suarez
committed
Use CircleCI to automatically deploy main branch to staging on every merge
1 parent 839ae72 commit 829fa4d

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

.circleci/config.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
version: 2.1
2+
parameters:
3+
aws-profile:
4+
type: string
5+
default: default
6+
aws-region:
7+
type: string
8+
default: us-east-2
9+
cluster-name:
10+
type: string
11+
default: operationcode-backend
212

313
orbs:
414
docker: circleci/docker@0.5.1
15+
aws-eks: circleci/aws-eks@0.2.7
516

617
workflows:
718
build_test_deploy:
@@ -64,4 +75,28 @@ jobs:
6475
- run:
6576
name: Run Bandit security analysis
6677
command: |
67-
make bandit
78+
make bandit
79+
80+
staging_deploy:
81+
executor: python3
82+
parameters:
83+
cluster-name:
84+
description: |
85+
Operation Code Backend Cluster
86+
type: string
87+
steps:
88+
- update-kubeconfig-with-authenticator:
89+
aws-profile: << parameters.aws-profile >>
90+
aws-region: << parameters.aws-region >>
91+
cluster-name: << parameters.cluster-name >>
92+
install-kubectl: true
93+
- aws-eks/update-container-image:
94+
container-image-updates: 'resources-api=resources-api:${CIRCLE_BUILD_NUM}'
95+
namespace: 'operationcode-staging'
96+
record: true
97+
requires:
98+
- docker/publish
99+
filters:
100+
branches:
101+
only:
102+
- main

0 commit comments

Comments
 (0)