2022-11-16 09:45:10 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) Edgeless Systems GmbH
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
shopt -s inherit_errexit
|
|
|
|
|
2023-02-27 12:19:52 -05:00
|
|
|
if [[ -f ${CONFIG_FILE-} ]]; then
|
2022-11-16 09:45:10 -05:00
|
|
|
# shellcheck source=/dev/null
|
|
|
|
. "${CONFIG_FILE}"
|
|
|
|
fi
|
|
|
|
|
2023-01-31 04:44:19 -05:00
|
|
|
path="constellation/v1/ref/${REF}/stream/${STREAM}/${IMAGE_VERSION}/image/csp/qemu/image.raw"
|
2022-12-09 05:51:38 -05:00
|
|
|
aws s3 cp "${QEMU_IMAGE_PATH}" "s3://${QEMU_BUCKET}/${path}" --no-progress
|
2022-11-16 09:45:10 -05:00
|
|
|
|
2022-12-09 05:51:38 -05:00
|
|
|
image_url="${QEMU_BASE_URL}/${path}"
|
2022-11-16 09:45:10 -05:00
|
|
|
|
|
|
|
json=$(jq -ncS \
|
|
|
|
--arg image_url "${image_url}" \
|
|
|
|
'{"qemu": {"default": $image_url}}')
|
|
|
|
echo -n "${json}" > "${QEMU_JSON_OUTPUT}"
|