constellation/hack/find-image/find-image.sh
2022-11-18 12:08:34 +01:00

27 lines
700 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) Edgeless Systems GmbH
#
# SPDX-License-Identifier: AGPL-3.0-only
# Usage: find-image.sh
set -euo pipefail
shopt -s inherit_errexit
base_url="https://cdn.confidential.cloud"
bucket="cdn-constellation-backend"
newest_debug_image_path=$(aws s3api list-objects-v2 \
--output text \
--bucket "${bucket}" \
--prefix constellation/v1/images/debug-v \
--query "reverse(sort_by(Contents, &LastModified))[0].Key")
image_version_uid=$(basename "${newest_debug_image_path}" .json)
url="${base_url}/${newest_debug_image_path}"
echo "Found image version UID:"
echo "${image_version_uid}"
echo "Containing the following images:"
echo "${url}"
curl -sL "${url}" | jq