Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Build_Deploy Script to Support SC Branch #190

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading