Skip to content

Commit

Permalink
Update build_deploy.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
ddonahue007 committed Sep 21, 2023
1 parent a9701ce commit 0eba00f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ lib64
tmp
scripts/minio-conf/
scripts/minio-data/
temp/
temp/
.idea
15 changes: 11 additions & 4 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -exv
IMAGE_NAME="quay.io/cloudservices/yuptoo"
IMAGE_TAG=$(git rev-parse --short=7 HEAD)
ADDITIONAL_TAGS="qa latest"
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"
Expand All @@ -23,7 +24,13 @@ docker --config="$DOCKER_CONF" login -u="$RH_REGISTRY_USER" -p="$RH_REGISTRY_TOK
docker --config="$DOCKER_CONF" build -t "${IMAGE_NAME}:${IMAGE_TAG}" .
docker --config="$DOCKER_CONF" push "${IMAGE_NAME}:${IMAGE_TAG}"

for ADDITIONAL_TAG in $ADDITIONAL_TAGS; do
docker --config="$DOCKER_CONF" tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${ADDITIONAL_TAG}"
docker --config="$DOCKER_CONF" push "${IMAGE_NAME}:${ADDITIONAL_TAG}"
done

if [[ $GIT_BRANCH == *"security-compliance"* ]]; then
docker --config="$DOCKER_CONF" tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${SECURITY_COMPLIANCE_TAG}"
docker --config="$DOCKER_CONF" push "${IMAGE_NAME}:${SECURITY_COMPLIANCE_TAG}"
else
for ADDITIONAL_TAG in $ADDITIONAL_TAGS; do
docker --config="$DOCKER_CONF" tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${ADDITIONAL_TAG}"
docker --config="$DOCKER_CONF" push "${IMAGE_NAME}:${ADDITIONAL_TAG}"
done
fi

0 comments on commit 0eba00f

Please sign in to comment.