Skip to content

Commit

Permalink
Merge pull request #190 from casey-williams-rh/update-build-deploy-sc…
Browse files Browse the repository at this point in the history
…ript

Update Build_Deploy Script to Support SC Branch
  • Loading branch information
maknop committed Sep 18, 2024
2 parents 904a776 + 801930b commit 604dcbb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -exv

IMAGE="quay.io/cloudservices/frontend-operator"
IMAGE_TAG=$(git rev-parse --short=7 HEAD)
SECURITY_COMPLIANCE_TAG="sc-$(date +%Y%m%d)-$(git rev-parse --short=7 HEAD)"
export BUILDER_NAME="builder-${JOB_NAME}-${BUILD_ID}"

if [[ -z "$QUAY_USER" || -z "$QUAY_TOKEN" ]]; then
Expand All @@ -27,10 +28,19 @@ if docker buildx ls | grep -q "multiarchbuilder"; then
docker buildx use multiarchbuilder
echo "Using multiarchbuilder for buildx"
# Multi-architecture build
docker buildx build --platform linux/amd64,linux/arm64 -t "${IMAGE}:${IMAGE_TAG}" --push .
if [[ $GIT_BRANCH == *"security-compliance"* ]]; then
docker buildx build --platform linux/amd64,linux/arm64 -t "${IMAGE}:${SECURITY_COMPLIANCE_TAG}" --push .
else
docker buildx build --platform linux/amd64,linux/arm64 -t "${IMAGE}:${IMAGE_TAG}" --push .
fi
else
echo "Falling back to standard build and push"
# Standard build and push
docker build -t "${IMAGE}:${IMAGE_TAG}" .
docker push "${IMAGE}:${IMAGE_TAG}"
if [[ $GIT_BRANCH == *"security-compliance"* ]]; then
docker build -t "${IMAGE}:${SECURITY_COMPLIANCE_TAG}" .
docker push "${IMAGE}:${SECURITY_COMPLIANCE_TAG}"
else
docker build -t "${IMAGE}:${IMAGE_TAG}" .
docker push "${IMAGE}:${IMAGE_TAG}"
fi
fi

0 comments on commit 604dcbb

Please sign in to comment.