From 7db1d81a819f1eb9b9835f517f5c2df6deb85cc3 Mon Sep 17 00:00:00 2001 From: Casey Williams Date: Tue, 10 Oct 2023 10:23:08 -0400 Subject: [PATCH] Adding Security-Compliance Branch Build and Tagging Support (#1048) Add Security-Compliance Branch Build and Tagging Support. --- build_deploy.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build_deploy.sh b/build_deploy.sh index 4f2f7bc51..5a5a514ef 100755 --- a/build_deploy.sh +++ b/build_deploy.sh @@ -4,6 +4,7 @@ set -exv IMAGE="quay.io/cloudservices/vmaas-app" IMAGE_TAG=$(git rev-parse --short=7 HEAD) +SECURITY_COMPLIANCE_TAG="sc-$(date +%Y%m%d)-$(git rev-parse --short=7 HEAD)" if [[ -z "$QUAY_USER" || -z "$QUAY_TOKEN" ]]; then echo "QUAY_USER and QUAY_TOKEN must be set" @@ -23,5 +24,11 @@ podman login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io podman login -u="$RH_REGISTRY_USER" -p="$RH_REGISTRY_TOKEN" registry.redhat.io podman build --build-arg STATIC_ASSETS=1 --pull=true -f Dockerfile -t "${IMAGE}:${IMAGE_TAG}" . podman push "${IMAGE}:${IMAGE_TAG}" -podman tag "${IMAGE}:${IMAGE_TAG}" "${IMAGE}:latest" -podman push "${IMAGE}:latest" + +if [[ $GIT_BRANCH == "origin/security-compliance" ]]; then + podman tag "${IMAGE}:${IMAGE_TAG}" "${IMAGE}:${SECURITY_COMPLIANCE_TAG}" + podman push "${IMAGE}:${SECURITY_COMPLIANCE_TAG}" +else + podman tag "${IMAGE}:${IMAGE_TAG}" "${IMAGE}:latest" + podman push "${IMAGE}:latest" +fi