Skip to content

Commit

Permalink
Update scripts/package-repo-import.sh
Browse files Browse the repository at this point in the history
Co-authored-by: Carl Tashian <[email protected]>
  • Loading branch information
jdoss and tashian authored Jul 23, 2024
1 parent 1c2450f commit fdfec4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/package-repo-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ check_package() {
local REPO="${1}"
local VER="${2}"
if [ ! -f /tmp/version-deleted.stamp ]; then
gcloud artifacts versions list --repository "${REPO}" --location "${GCLOUD_LOCATION}" --package "${PACKAGE}" \
--filter "VERSION:${VER}" --format json 2> /dev/null |jq -re '.[].name?' >/dev/null 2>&1 || EXITCODE=$?
gcloud artifacts versions list \
--repository "${REPO}" \
--location "${GCLOUD_LOCATION}" \
--package "${PACKAGE}" \
--filter "VERSION:${VER}" \
--format json 2> /dev/null \
| jq -re '.[].name?' >/dev/null 2>&1 \
|| EXITCODE=$?
if [[ "${EXITCODE}" -eq 0 ]]; then
echo "Package version already exists. Removing it..."
gcloud artifacts versions delete --quiet "${VER}" --package "${PACKAGE}" --repository "${REPO}" --location "${GCLOUD_LOCATION}"
Expand Down

0 comments on commit fdfec4a

Please sign in to comment.