Push multiple Docker tags for image in CD.
This will allow Kubernetes resources that only pull images occasionally (i.e., k8s jobs) to point to a static tag name, "latest", that is updated regularly. It also means we can refer to that image in the k8s config tracked in the repo, instead of out-of-date images.
This commit is contained in:
parent
97545234e9
commit
ace222fe95
@ -1,9 +1,9 @@
|
|||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
orbs:
|
orbs:
|
||||||
aws-ecr: circleci/aws-ecr@4.0.1
|
aws-ecr: circleci/aws-ecr@6.3.0
|
||||||
aws-eks: circleci/aws-eks@0.1.0
|
aws-eks: circleci/aws-eks@0.1.0
|
||||||
azure-acr: circleci/azure-acr@0.1.1
|
azure-acr: circleci/azure-acr@0.1.2
|
||||||
azure-aks: circleci/azure-aks@0.2.0
|
azure-aks: circleci/azure-aks@0.2.0
|
||||||
kubernetes: circleci/kubernetes@0.3.0
|
kubernetes: circleci/kubernetes@0.3.0
|
||||||
|
|
||||||
@ -120,6 +120,21 @@ jobs:
|
|||||||
resource-group: atat
|
resource-group: atat
|
||||||
- migration_apply
|
- migration_apply
|
||||||
|
|
||||||
|
# the azure-acr orb doesn't allow for multiple tags in the
|
||||||
|
# build-and-push-image step, so instead we wrap our own job around it and run
|
||||||
|
# some additional Docker commands
|
||||||
|
azure-build-and-push-image:
|
||||||
|
executor: azure-acr/default
|
||||||
|
steps:
|
||||||
|
- azure-acr/build-and-push-image:
|
||||||
|
extra-build-args: "--build-arg CSP=azure"
|
||||||
|
login-server-name: "${AZURE_SERVER_NAME}"
|
||||||
|
registry-name: pwatat
|
||||||
|
repo: atat
|
||||||
|
tag: "${CIRCLE_SHA1}"
|
||||||
|
- run: "docker tag ${AZURE_SERVER_NAME}/atat:${CIRCLE_SHA1} ${AZURE_SERVER_NAME}/atat:latest"
|
||||||
|
- run: "docker push ${AZURE_SERVER_NAME}/atat:latest"
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
run-tests:
|
run-tests:
|
||||||
@ -128,12 +143,7 @@ workflows:
|
|||||||
- test:
|
- test:
|
||||||
requires:
|
requires:
|
||||||
- app_setup
|
- app_setup
|
||||||
- azure-acr/build_and_push_image:
|
- azure-build-and-push-image:
|
||||||
extra-build-args: "--build-arg CSP=azure"
|
|
||||||
login-server-name: "${AZURE_SERVER_NAME}"
|
|
||||||
registry-name: pwatat
|
|
||||||
repo: atat
|
|
||||||
tag: "${CIRCLE_SHA1}"
|
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
filters:
|
filters:
|
||||||
@ -142,7 +152,7 @@ workflows:
|
|||||||
- master
|
- master
|
||||||
- azure-migration:
|
- azure-migration:
|
||||||
requires:
|
requires:
|
||||||
- azure-acr/build_and_push_image
|
- azure-build-and-push-image
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
@ -175,10 +185,10 @@ workflows:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- aws-ecr/build_and_push_image:
|
- aws-ecr/build-and-push-image:
|
||||||
extra-build-args: "--build-arg CSP=aws"
|
extra-build-args: "--build-arg CSP=aws"
|
||||||
repo: atat
|
repo: atat
|
||||||
tag: "${CIRCLE_SHA1}"
|
tag: "${CIRCLE_SHA1},latest"
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
filters:
|
filters:
|
||||||
@ -187,7 +197,7 @@ workflows:
|
|||||||
- master
|
- master
|
||||||
- aws-migration:
|
- aws-migration:
|
||||||
requires:
|
requires:
|
||||||
- aws-ecr/build_and_push_image
|
- aws-ecr/build-and-push-image
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
@ -28,7 +28,7 @@ spec:
|
|||||||
fsGroup: 101
|
fsGroup: 101
|
||||||
containers:
|
containers:
|
||||||
- name: atst
|
- name: atst
|
||||||
image: 904153757533.dkr.ecr.us-east-2.amazonaws.com/atat:4d14326ba77f1b3287b3c436a2d9be064bf4fba3
|
image: 904153757533.dkr.ecr.us-east-2.amazonaws.com/atat:latest
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "500Mi"
|
memory: "500Mi"
|
||||||
@ -139,7 +139,7 @@ spec:
|
|||||||
fsGroup: 101
|
fsGroup: 101
|
||||||
containers:
|
containers:
|
||||||
- name: atst-worker
|
- name: atst-worker
|
||||||
image: 904153757533.dkr.ecr.us-east-2.amazonaws.com/atat:4d14326ba77f1b3287b3c436a2d9be064bf4fba3
|
image: 904153757533.dkr.ecr.us-east-2.amazonaws.com/atat:latest
|
||||||
args: [
|
args: [
|
||||||
"/opt/atat/atst/.venv/bin/python",
|
"/opt/atat/atst/.venv/bin/python",
|
||||||
"/opt/atat/atst/.venv/bin/celery",
|
"/opt/atat/atst/.venv/bin/celery",
|
||||||
|
@ -12,7 +12,7 @@ spec:
|
|||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
containers:
|
containers:
|
||||||
- name: crls
|
- name: crls
|
||||||
image: 904153757533.dkr.ecr.us-east-2.amazonaws.com/atat:8f1c8b5633ca70168837c885010e7d66d93562dc
|
image: 904153757533.dkr.ecr.us-east-2.amazonaws.com/atat:latest
|
||||||
command: [
|
command: [
|
||||||
"/bin/sh", "-c"
|
"/bin/sh", "-c"
|
||||||
]
|
]
|
||||||
|
@ -28,7 +28,7 @@ spec:
|
|||||||
fsGroup: 101
|
fsGroup: 101
|
||||||
containers:
|
containers:
|
||||||
- name: atst
|
- name: atst
|
||||||
image: pwatat.azurecr.io/atat:4d14326ba77f1b3287b3c436a2d9be064bf4fba3
|
image: pwatat.azurecr.io/atat:latest
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "500Mi"
|
memory: "500Mi"
|
||||||
@ -140,7 +140,7 @@ spec:
|
|||||||
fsGroup: 101
|
fsGroup: 101
|
||||||
containers:
|
containers:
|
||||||
- name: atst-worker
|
- name: atst-worker
|
||||||
image: pwatat.azurecr.io/atat:4d14326ba77f1b3287b3c436a2d9be064bf4fba3
|
image: pwatat.azurecr.io/atat:latest
|
||||||
args: [
|
args: [
|
||||||
"/opt/atat/atst/.venv/bin/python",
|
"/opt/atat/atst/.venv/bin/python",
|
||||||
"/opt/atat/atst/.venv/bin/celery",
|
"/opt/atat/atst/.venv/bin/celery",
|
||||||
|
@ -12,7 +12,7 @@ spec:
|
|||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
containers:
|
containers:
|
||||||
- name: crls
|
- name: crls
|
||||||
image: pwatat.azurecr.io/atat:8f1c8b5633ca70168837c885010e7d66d93562dc
|
image: pwatat.azurecr.io/atat:latest
|
||||||
command: [
|
command: [
|
||||||
"/bin/sh", "-c"
|
"/bin/sh", "-c"
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user