Working config for CD.

This adds the AWS and Azure CircleCI orbs for updating container images
in a cluster. It installs the clients for both CSPs, configures kubectl
with a programmatic user's auth information, and executes a `kubectl set
image` command to reset the cluster image to the one that was just
pushed to the container registry.
This commit is contained in:
dandds 2019-07-17 15:24:04 -04:00
parent 52829a1236
commit d056191b01

View File

@ -2,7 +2,9 @@ version: 2.1
orbs: orbs:
aws-ecr: circleci/aws-ecr@4.0.1 aws-ecr: circleci/aws-ecr@4.0.1
aws-eks: circleci/aws-eks@0.1.0
azure-acr: circleci/azure-acr@0.1.1 azure-acr: circleci/azure-acr@0.1.1
azure-aks: circleci/azure-aks@0.2.0
defaults: defaults:
appEnvironment: &appEnvironment appEnvironment: &appEnvironment
@ -83,15 +85,6 @@ workflows:
- test: - test:
requires: requires:
- app_setup - app_setup
- aws-ecr/build_and_push_image:
repo: atat
tag: "${CIRCLE_SHA1}"
requires:
- test
filters:
branches:
only:
- master
- azure-acr/build_and_push_image: - azure-acr/build_and_push_image:
login-server-name: "${AZURE_SERVER_NAME}" login-server-name: "${AZURE_SERVER_NAME}"
registry-name: pwatat registry-name: pwatat
@ -103,3 +96,68 @@ workflows:
branches: branches:
only: only:
- master - master
- azure-aks/update-container-image:
cluster-name: atat-cluster
container-image-updates: "atst=${AZURE_SERVER_NAME}/atat:${CIRCLE_SHA1}"
namespace: atat
resource-name: deployment.apps/atst
resource-group: atat
# uncomment below for debugging
# show-kubectl-command: true
requires:
- azure-acr/build_and_push_image
filters:
branches:
only:
- master
- azure-aks/update-container-image:
cluster-name: atat-cluster
container-image-updates: "atst-worker=${AZURE_SERVER_NAME}/atat:${CIRCLE_SHA1}"
namespace: atat
resource-name: deployment.apps/atst-worker
resource-group: atat
# uncomment below for debugging
# show-kubectl-command: true
requires:
- azure-acr/build_and_push_image
filters:
branches:
only:
- master
- aws-ecr/build_and_push_image:
repo: atat
tag: "${CIRCLE_SHA1}"
requires:
- test
filters:
branches:
only:
- master
- aws-eks/update-container-image:
cluster-name: atat
container-image-updates: "atst=${AWS_ECR_ACCOUNT_URL}/atat:${CIRCLE_SHA1}"
namespace: atat
resource-name: deployment.apps/atst
aws-region: "${AWS_REGION}"
# uncomment below for debugging
# show-kubectl-command: true
requires:
- aws-ecr/build_and_push_image
filters:
branches:
only:
- master
- aws-eks/update-container-image:
cluster-name: atat
container-image-updates: "atst-worker=${AWS_ECR_ACCOUNT_URL}/atat:${CIRCLE_SHA1}"
namespace: atat
resource-name: deployment.apps/atst-worker
aws-region: "${AWS_REGION}"
# uncomment below for debugging
# show-kubectl-command: true
requires:
- aws-ecr/build_and_push_image
filters:
branches:
only:
- master