From 430d3530ae08e57a14b7290ebc5fc98fe783f0c6 Mon Sep 17 00:00:00 2001 From: Rui Fu Date: Thu, 21 Sep 2023 09:58:46 +0800 Subject: [PATCH] fix script (#694) --- hack/publish-rhel.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hack/publish-rhel.sh b/hack/publish-rhel.sh index 3db08184..4cfdefba 100755 --- a/hack/publish-rhel.sh +++ b/hack/publish-rhel.sh @@ -100,6 +100,12 @@ publish_the_image() return 1 fi else + local IMAGE_RELEASED=$(get_image published "${RHEL_PROJECT_ID}" "${VERSION}" "${RHEL_API_KEY}") + local IMAGE_RELEASED_EXISTS=$(echo $IMAGE_RELEASED | jq -r '.total') + if [[ $IMAGE_RELEASED_EXISTS != "0" ]]; then + echo "Image you are trying to publish is already published." + return 0 + fi echo "Image you are trying to publish does not exist." return 1 fi