Skip to content

Commit

Permalink
mess with conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
daler committed Feb 17, 2024
1 parent c545c66 commit f8783f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ jobs:
- name: Build base-debian
id: base-debian
run: |
# Will exit 64 if the tag exists. We don't want the entire Actions
# workflow to fail because of it.
IMAGE_NAME=$BASE_DEBIAN_IMAGE_NAME \
IMAGE_DIR=images/base-glibc-debian-bash \
TYPE="base-debian" \
DEBIAN_VERSION=$DEBIAN_VERSION \
ARCHS=$ARCHS \
TAGS=$BASE_TAGS \
./generic_build.bash
./generic_build.bash || [ $? == 64 ]
cat "${TYPE}.log" >> $GITHUB_OUTPUT
Expand All @@ -59,7 +61,7 @@ jobs:
- name: Push base-debian
id: push-base-debian
uses: redhat-actions/push-to-registry@v2
if: ${{ steps.base-debian.outputs.TAG_EXISTS_base-debian != "true" }}
if: ${{ steps.base-debian.outputs.TAG_EXISTS_base-debian == "false" }}
with:
image: ${{ env.BASE_DEBIAN_IMAGE_NAME }}
tags: ${{ env.BASE_TAGS }}
Expand Down
4 changes: 3 additions & 1 deletion generic_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ for tag in $TAGS ; do
if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then
printf 'error: tag %s already exists for %s on quay.io!\n' "${tag}" "${IMAGE_NAME}"
echo "TAG_EXISTS_${TYPE}=true" >> $LOG
exit 1
exit 64
fi
esac
done

echo "TAG_EXISTS_${TYPE}=false"

#-------------------------------------------------------------------------------
# SETUP

Expand Down

0 comments on commit f8783f4

Please sign in to comment.