Skip to content

Commit

Permalink
fix(build_deploy): only create sc tag when building sc branch
Browse files Browse the repository at this point in the history
  • Loading branch information
casey-williams-rh authored and skateman committed Apr 23, 2024
1 parent 1727673 commit c20fb95
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ CICD_TOOLS_URL="https://raw.githubusercontent.com/RedHatInsights/cicd-tools/main
source <(curl -sSL "$CICD_TOOLS_URL") image_builder

export CICD_IMAGE_BUILDER_IMAGE_NAME='quay.io/cloudservices/compliance-backend'
export CICD_IMAGE_BUILDER_BUILD_ARGS=("IMAGE_TAG=$(cicd::image_builder::get_image_tag)")

# Check if the current Git branch is 'origin/security-compliance'.
if [[ "$GIT_BRANCH" == "origin/security-compliance" ]]; then
# Generate a tag for the Docker image based on the current date and Git commit short hash.
# Generate a tag for the container image based on the current date and Git commit short hash.
SECURITY_COMPLIANCE_TAG="sc-$(date +%Y%m%d)-$(git rev-parse --short=7 HEAD)"

# Set ADDITIONAL_TAGS to the generated security compliance tag.
export CICD_IMAGE_BUILDER_ADDITIONAL_TAGS=("$SECURITY_COMPLIANCE_TAG")
export CICD_IMAGE_BUILDER_BUILD_ARGS=("IMAGE_TAG=$SECURITY_COMPLIANCE_TAG")
else
# If the current Git branch is not 'origin/security-compliance':
export CICD_IMAGE_BUILDER_BUILD_ARGS=("IMAGE_TAG=$(cicd::image_builder::get_image_tag)")
export CICD_IMAGE_BUILDER_ADDITIONAL_TAGS=("latest")
fi

Expand Down

0 comments on commit c20fb95

Please sign in to comment.