mirror of
https://github.com/quay/quay.git
synced 2025-04-18 10:44:06 +03:00
post-deploy is used to push the image to backup ECR. Don't remove the image before this is run
30 lines
624 B
Bash
Executable File
30 lines
624 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# AppSRE team CD
|
|
|
|
set -exv
|
|
|
|
CURRENT_DIR=$(dirname $0)
|
|
|
|
BASE_IMG="quay-py3"
|
|
QUAY_IMAGE="quay.io/app-sre/${BASE_IMG}"
|
|
IMG="${BASE_IMG}:latest"
|
|
|
|
GIT_HASH=`git rev-parse --short=7 HEAD`
|
|
|
|
# build the image
|
|
BUILD_CMD="docker build" IMG="$IMG" make app-sre-docker-build
|
|
|
|
# save the image as a tar archive
|
|
docker save ${IMG} -o ${BASE_IMG}
|
|
|
|
# push the image
|
|
skopeo copy --dest-creds "${QUAY_USER}:${QUAY_TOKEN}" \
|
|
"docker-archive:${BASE_IMG}" \
|
|
"docker://${QUAY_IMAGE}:latest"
|
|
|
|
skopeo copy --dest-creds "${QUAY_USER}:${QUAY_TOKEN}" \
|
|
"docker-archive:${BASE_IMG}" \
|
|
"docker://${QUAY_IMAGE}:${GIT_HASH}"
|
|
|