From f2b324cb88aa78caa27ad2ab260c510e690bc656 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 13 Dec 2022 11:08:36 +0100 Subject: [PATCH] hack: rename find-image dir Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- .github/actions/find_latest_image/action.yaml | 2 +- debugd/README.md | 2 +- hack/{find-image => api}/find-image.sh | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) rename hack/{find-image => api}/find-image.sh (92%) diff --git a/.github/actions/find_latest_image/action.yaml b/.github/actions/find_latest_image/action.yaml index dd8bddb84..b0193bcf8 100644 --- a/.github/actions/find_latest_image/action.yaml +++ b/.github/actions/find_latest_image/action.yaml @@ -34,4 +34,4 @@ runs: run: | image=$(./find-image.sh --ref "${ref}" --stream "${stream}") echo "image=${image}" >> "${GITHUB_OUTPUT}" - working-directory: hack/find-image + working-directory: hack/api diff --git a/debugd/README.md b/debugd/README.md index 37bac6437..5b8cf8b3c 100644 --- a/debugd/README.md +++ b/debugd/README.md @@ -22,7 +22,7 @@ With `cdbg` and `yq` installed in your path: 1. Run `constellation config generate` to create a new default configuration -2. Locate the latest debugd images by running `hack/find-image/find-image.sh --ref main --stream debug` +2. Locate the latest debugd images by running `hack/api/find-image.sh --ref main --stream debug` 3. Modify the `constellation-conf.yaml` to use an image with the debugd already included and add required firewall rules: diff --git a/hack/find-image/find-image.sh b/hack/api/find-image.sh similarity index 92% rename from hack/find-image/find-image.sh rename to hack/api/find-image.sh index 2c3d17dab..3d0bc3091 100755 --- a/hack/find-image/find-image.sh +++ b/hack/api/find-image.sh @@ -12,7 +12,7 @@ json=false cdn_url="https://cdn.confidential.cloud" function usage() { - cat <<'EOF' + cat << 'EOF' Usage: find-image.sh [options] [command] Options: @@ -95,7 +95,7 @@ function latest() { latest_json=$(curl -sL "${latest_url}") if [[ ${json} == true ]]; then - jq <<<"${latest_json}" + jq <<< "${latest_json}" exit 0 fi @@ -133,12 +133,12 @@ function list() { if [[ ${json} == true ]]; then out="{}" - out=$(jq <<<"${out}" --arg ref "${ref}" '.ref = $ref') - out=$(jq <<<"${out}" --arg stream "${stream}" '.stream = $stream') + out=$(jq <<< "${out}" --arg ref "${ref}" '.ref = $ref') + out=$(jq <<< "${out}" --arg stream "${stream}" '.stream = $stream') for patch in ${patch_list}; do - out=$(jq <<<"${out}" --arg patch "${patch}" '.versions += [$patch]') + out=$(jq <<< "${out}" --arg patch "${patch}" '.versions += [$patch]') done - jq <<<"${out}" + jq <<< "${out}" exit 0 fi @@ -148,7 +148,6 @@ function list() { exit 0 } - case ${1-"latest"} in "list") list