1
0
mirror of https://github.com/quay/quay.git synced 2025-04-18 10:44:06 +03:00
quay/scripts/app_sre_build_deploy_centos7.sh
Syed Mushtaq Ahmed d2f4efd842
build: Remove the image archive in post-deploy (PROJQUAY-2372) (#963)
post-deploy is used to push the image to backup ECR. Don't remove
the image before this is run
2021-11-08 14:57:51 -05:00

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}"