Skip to content

Commit

Permalink
Merge pull request #2188 from broadinstitute/development
Browse files Browse the repository at this point in the history
Release 1.88.0
  • Loading branch information
eweitz authored Jan 15, 2025
2 parents 3a0123d + 6aa7807 commit 8a2666c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
19 changes: 15 additions & 4 deletions bin/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@ function main {
# upcoming release, e.g. 1.20.0.
# More context: https://github.com/broadinstitute/single_cell_portal_core/pull/1552#discussion_r910424433
# TODO: (SCP-4496): Move production-related GCR images out of staging project

# Google Artifact Registry (GAR) formats Docker image names differently than the canonical Container Registry format
# both refer to the same image digest and will work with 'docker pull', but the GCR names do not work with any
# 'gcloud artifacts docker' commands
# for example:
# GCR name: gcr.io/broad-singlecellportal-staging/single-cell-portal
# GAR name: us-docker.pkg.dev/broad-singlecellportal-staging/gcr.io/single-cell-portal
VERSION_TAG=$(extract_release_tag "0")
IMAGE_NAME='gcr.io/broad-singlecellportal-staging/single-cell-portal'
REPO='gcr.io'
PROJECT='broad-singlecellportal-staging'
IMAGE='single-cell-portal'
GAR_NAME="us-docker.pkg.dev/$PROJECT/$REPO/$IMAGE"
IMAGE_NAME="$REPO/$PROJECT/$IMAGE"
GCLOUD_ALIAS='gcloud'
while getopts "v:g:h" OPTION; do
case $OPTION in
Expand All @@ -50,7 +61,7 @@ function main {
done

# skip building a tagged release if it already exists, unless this is the development branch
EXISTING_DIGEST=$($GCLOUD_ALIAS container images list-tags $IMAGE_NAME --filter="tags:$VERSION_TAG" --format='get(digest)')
EXISTING_DIGEST=$($GCLOUD_ALIAS artifacts docker images list $GAR_NAME --include-tags --filter="tags=$VERSION_TAG" --format='get(version)')
if [[ "$VERSION_TAG" != 'development' ]] && [[ -n "$EXISTING_DIGEST" ]]; then
exit_with_error_message "unable to build $VERSION_TAG as it already exists with digest $EXISTING_DIGEST"
fi
Expand All @@ -63,10 +74,10 @@ function main {
echo "*** PUSH COMPLETE ***"
# pushing an image with the same tag as an existing one (which will happen each time with 'development') can leave
# behind an untagged image that needs to be deleted - these can be found with --filter='-tags:*'
UNTAGGED=$($GCLOUD_ALIAS container images list-tags $IMAGE_NAME --filter="-tags:*" --format="get(digest)")
UNTAGGED=$($GCLOUD_ALIAS artifacts docker images list $GAR_NAME --include-tags --filter="-tags:*" --format="get(version)")
if [[ -n "$UNTAGGED" ]]; then
echo "*** DELETING UNTAGGED IMAGE DIGEST $UNTAGGED ***"
$GCLOUD_ALIAS container images delete $IMAGE_NAME@$UNTAGGED --quiet || exit_with_error_message "could not delete image $UNTAGGED"
$GCLOUD_ALIAS artifacts docker images delete $GAR_NAME@$UNTAGGED --quiet || exit_with_error_message "could not delete image $UNTAGGED"
echo "*** UNTAGGED IMAGE $UNTAGGED SUCCESSFULLY DELETED ***"
fi
}
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6877,9 +6877,9 @@ nan@^2.12.1:
integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==

nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
version "3.3.8"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf"
integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==

nanomatch@^1.2.9:
version "1.2.13"
Expand Down

0 comments on commit 8a2666c

Please sign in to comment.