From 1225a96e6a63720d9bda789ef0ee426086b13662 Mon Sep 17 00:00:00 2001 From: Techassi Date: Thu, 10 Oct 2024 15:03:19 +0200 Subject: [PATCH 1/2] chore: Remove unused scripts --- .scripts/enumerate-product-versions.py | 37 -------------------------- .scripts/get_manifest_digest.sh | 11 -------- .scripts/get_repo_digest.sh | 33 ----------------------- 3 files changed, 81 deletions(-) delete mode 100644 .scripts/enumerate-product-versions.py delete mode 100755 .scripts/get_manifest_digest.sh delete mode 100755 .scripts/get_repo_digest.sh diff --git a/.scripts/enumerate-product-versions.py b/.scripts/enumerate-product-versions.py deleted file mode 100644 index 7c3180c26..000000000 --- a/.scripts/enumerate-product-versions.py +++ /dev/null @@ -1,37 +0,0 @@ -import sys -import os - -# NOTE: This script (used in the release workflow as of 2024-07-23) relies on conf.py being in its parent folder. Should either file be moved or the structure changed in any way remember to update this script as well. -# Add parent directory to the sys.path -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - -import conf - -PRODUCTS = [ - "airflow", - "druid", - "hadoop", - "hbase", - "hive", - "kafka", - "kafka-testing-tools", - "krb5", - "nifi", - "opa", - "omid", - "spark-k8s", - "superset", - "testing-tools", - "trino", - "trino-cli", - "tools", - "zookeeper", -] - -for product in conf.products: - product_name = product["name"] - if product_name not in PRODUCTS: - continue - - for version in product["versions"]: - print(f"{product_name}#{version['product']}") diff --git a/.scripts/get_manifest_digest.sh b/.scripts/get_manifest_digest.sh deleted file mode 100755 index 38712264f..000000000 --- a/.scripts/get_manifest_digest.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Get a manifest digest. Example inputs: -# - docker.stackable.tech/stackable/hello-world:0.0.1-SNAPSHOT-stackable0.0.0-dev -# - docker.stackable.tech/stackable/hello-world:0.0.1-SNAPSHOT-stackable0.0.0-dev-amd64 -set -euo pipefail - -# Note: `docker manifest push` currently outputs the same hash, but `manifest` -# is experimental and the STDOUT is more likely to change than the structured -# output. -docker buildx imagetools inspect --format '{{println .Manifest.Digest}}' "$1" diff --git a/.scripts/get_repo_digest.sh b/.scripts/get_repo_digest.sh deleted file mode 100755 index 74a26d53a..000000000 --- a/.scripts/get_repo_digest.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# The script outputs the image manifest uri with the SHA256 digest, for example: -# oci.stackable.tech/sdp/hello-world@sha256:917f800259ef4915f976e93987b752fd64debf347568610d7f685d20220fc88a -set -euo pipefail - -# There is only one input to this script, which contains the entire image -# manifest uri, like: oci.stackable.tech/sdp/hello-world:0.0.1-SNAPSHOT-stackable0.0.0-dev-arm64 -IMAGE_MANIFEST_URI="$1" - -# Here, we cut off the image manifest tag to get the image repository uri, for -# example: oci.stackable.tech/sdp/hello-world -IMAGE_REPOSITORY_URI="$(echo "$IMAGE_MANIFEST_URI" | cut -d : -f 1)" - -IMAGE_REPO_DIGEST=$( - docker inspect "$IMAGE_MANIFEST_URI" --format json | \ - jq -r \ - --arg IMAGE_REPOSITORY_URI "$IMAGE_REPOSITORY_URI" \ - --arg IMAGE_MANIFEST_URI "$IMAGE_MANIFEST_URI" \ - ' - map(select(.RepoTags[] | contains($IMAGE_MANIFEST_URI)))[0] - | .RepoDigests[] - | select(. | startswith($IMAGE_REPOSITORY_URI)) - ' -) - -# Ensure IMAGE_REPO_DIGEST is not empty -if [[ -z "$IMAGE_REPO_DIGEST" ]]; then - >&2 echo "Repo Digest is empty, but is required for signing" - exit 1 -fi - -echo "$IMAGE_REPO_DIGEST" From c4189f019116ba54ac9c70c5810c5617b55428f1 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 21 Oct 2024 09:51:37 +0200 Subject: [PATCH 2/2] chore: Partial revert of 1225a96 This restores the enumerate-product-versions script. --- .scripts/enumerate-product-versions.py | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .scripts/enumerate-product-versions.py diff --git a/.scripts/enumerate-product-versions.py b/.scripts/enumerate-product-versions.py new file mode 100644 index 000000000..7c3180c26 --- /dev/null +++ b/.scripts/enumerate-product-versions.py @@ -0,0 +1,37 @@ +import sys +import os + +# NOTE: This script (used in the release workflow as of 2024-07-23) relies on conf.py being in its parent folder. Should either file be moved or the structure changed in any way remember to update this script as well. +# Add parent directory to the sys.path +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import conf + +PRODUCTS = [ + "airflow", + "druid", + "hadoop", + "hbase", + "hive", + "kafka", + "kafka-testing-tools", + "krb5", + "nifi", + "opa", + "omid", + "spark-k8s", + "superset", + "testing-tools", + "trino", + "trino-cli", + "tools", + "zookeeper", +] + +for product in conf.products: + product_name = product["name"] + if product_name not in PRODUCTS: + continue + + for version in product["versions"]: + print(f"{product_name}#{version['product']}")