From 7589c5f220e64bd38f50a0d42ca277f8ab89dbe5 Mon Sep 17 00:00:00 2001 From: Westgate Agent Date: Sat, 27 Jun 2026 18:15:08 +0200 Subject: [PATCH 1/2] feat: add crucible image and sow-tools binary channel promote --- .gitea/workflows/build-binaries.yml | 18 ++++++ .gitea/workflows/build-image.yml | 19 +++++++ scripts/promote-crucible.sh | 85 +++++++++++++++++++++++++++++ scripts/promote-sow-tools.sh | 78 ++++++++++++++++++++++++++ tests/promote-crucible-contract.sh | 10 ++++ tests/promote-sow-tools-contract.sh | 10 ++++ 6 files changed, 220 insertions(+) create mode 100755 scripts/promote-crucible.sh create mode 100755 scripts/promote-sow-tools.sh create mode 100755 tests/promote-crucible-contract.sh create mode 100755 tests/promote-sow-tools-contract.sh diff --git a/.gitea/workflows/build-binaries.yml b/.gitea/workflows/build-binaries.yml index c99d1e4..f8235ff 100644 --- a/.gitea/workflows/build-binaries.yml +++ b/.gitea/workflows/build-binaries.yml @@ -69,3 +69,21 @@ jobs: "${api}/releases/${id}/assets?name=$(basename "$f")" done ' + + - name: Promote channel + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + env: + TAG: ${{ github.ref_name }} + GITEA_TOKEN: ${{ secrets.PACKAGE_TOKEN }} + GITEA_SERVER: ${{ github.server_url }} + GITEA_OWNER: ${{ github.repository_owner }} + GITEA_REPO: ${{ github.repository }} + run: | + nix develop --command bash -c ' + set -euo pipefail + if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + bash scripts/promote-sow-tools.sh release "$TAG" + else + printf "unsupported tag for service tier: %s\n" "$TAG" >&2; exit 1 + fi + ' diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index 6bfaeb7..38b6cb5 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -50,3 +50,22 @@ jobs: bash scripts/emit-release-fragment.sh - uses: actions/upload-artifact@v3 with: { name: release-fragment, path: release-fragment.json } + + # Service tier: only vX.Y.Z → release; anything else rejects. + # SHA is the 12-char git SHA from the "Resolve tag" step above. + - name: Promote channel + env: + TAG: ${{ github.ref_name }} + SHA: ${{ steps.tag.outputs.sha }} + GITEA_TOKEN: ${{ secrets.PACKAGE_TOKEN }} + GITEA_SERVER: ${{ github.server_url }} + GITEA_OWNER: ${{ github.repository_owner }} + REGISTRY_HOST: ${{ env.REGISTRY }} + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + run: | + if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + nix shell nixpkgs#skopeo --command bash scripts/promote-crucible.sh release "$SHA" + else + printf 'unsupported tag for service tier: %s\n' "$TAG" >&2; exit 1 + fi diff --git a/scripts/promote-crucible.sh b/scripts/promote-crucible.sh new file mode 100755 index 0000000..042d6b0 --- /dev/null +++ b/scripts/promote-crucible.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# vendored from sow-platform/deploy/scripts/promote-gitea.sh — keep in sync +# Channel pointer for crucible registry images (service tier). +# channels.json values are the 12-char git SHAs used as image tags. +set -euo pipefail + +: "${GITEA_SERVER:?set GITEA_SERVER}" +: "${GITEA_TOKEN:?set GITEA_TOKEN}" +: "${GITEA_OWNER:?set GITEA_OWNER}" +: "${REGISTRY_HOST:?set REGISTRY_HOST}" +: "${REGISTRY_USER:?set REGISTRY_USER}" +: "${REGISTRY_PASSWORD:?set REGISTRY_PASSWORD}" + +STREAM_NAME=crucible +STREAM_TIER=service +DRY_RUN="${DRY_RUN:-0}" + +need() { command -v "$1" >/dev/null 2>&1 || { printf 'need: %s not found\n' "$1" >&2; exit 1; }; } +need jq curl skopeo +die() { printf '[channels] ERROR: %s\n' "$*" >&2; exit 1; } +log() { printf '[channels] %s\n' "$*" >&2; } + +require_release() { + local tag="$1" + skopeo inspect \ + --creds "${REGISTRY_USER}:${REGISTRY_PASSWORD}" \ + "docker://${REGISTRY_HOST}/deployment/crucible:${tag}" \ + >/dev/null 2>&1 \ + || die "no published image crucible:${tag}" +} + +# ---- promote-gitea.sh body (paste verbatim from sow-platform/deploy/scripts/promote-gitea.sh) ---- +_auth="Authorization: token ${GITEA_TOKEN}" +_pkg_url="${GITEA_SERVER}/api/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}/channels.json" +_pkg_del="${GITEA_SERVER}/api/v1/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}" + +valid_channel() { case "$1" in current|previous) return 0 ;; *) return 1 ;; esac; } + +read_channels() { + local tmp status + tmp="$(mktemp)" + status="$(curl -fsS -o "$tmp" -w "%{http_code}" -H "$_auth" "$_pkg_url" 2>/dev/null || echo "000")" + case "$status" in + 200) jq -e . "$tmp" >/dev/null 2>&1 || die "existing channels.json is invalid"; cat "$tmp" ;; + 404|000) printf '{}\n' ;; + *) die "read channels.json: HTTP $status" ;; + esac + rm -f "$tmp" +} + +write_channels() { + local json="$1" tmp + jq -e . <<<"$json" >/dev/null 2>&1 || die "refusing to write invalid channels.json" + tmp="$(mktemp)"; jq -S . <<<"$json" >"$tmp" + if [[ "$DRY_RUN" == "1" ]]; then + log "DRY_RUN: would write:"; jq -S . "$tmp" >&2; rm -f "$tmp"; return 0 + fi + curl -fsS -X DELETE -H "$_auth" "$_pkg_del" >/dev/null 2>&1 || true + curl -fsS -X PUT -H "$_auth" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@$tmp" \ + "$_pkg_url" >/dev/null || die "write channels.json failed" + rm -f "$tmp" + log "deployment-channels/crucible updated" + jq -S . <<<"$json" >&2 +} + +cmd="${1:-show}" +case "$cmd" in + show) read_channels | jq -S . ;; + set) + channel="${2:?usage: promote set }" + tag="${3:?usage: promote set }" + valid_channel "$channel" || die "unknown channel: $channel" + require_release "$tag" + write_channels "$(read_channels | jq --arg c "$channel" --arg t "$tag" '.[$c]=$t')" + ;; + release) + tag="${2:?usage: promote release }" + require_release "$tag" + write_channels "$(read_channels | jq --arg t "$tag" ' + (if .current then .previous = .current else . end) | .current = $t')" + ;; + *) die "usage: promote show | set | release " ;; +esac diff --git a/scripts/promote-sow-tools.sh b/scripts/promote-sow-tools.sh new file mode 100755 index 0000000..f58f22a --- /dev/null +++ b/scripts/promote-sow-tools.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +# vendored from sow-platform/deploy/scripts/promote-gitea.sh — keep in sync +# Channel pointer for sow-tools binary releases (service tier). +# channels.json values are version tags (vX.Y.Z), not SHAs. +set -euo pipefail + +: "${GITEA_SERVER:?set GITEA_SERVER}" +: "${GITEA_TOKEN:?set GITEA_TOKEN}" +: "${GITEA_OWNER:?set GITEA_OWNER}" +: "${GITEA_REPO:?set GITEA_REPO}" + +STREAM_NAME=sow-tools +STREAM_TIER=service +DRY_RUN="${DRY_RUN:-0}" + +need() { command -v "$1" >/dev/null 2>&1 || { printf 'need: %s not found\n' "$1" >&2; exit 1; }; } +need jq curl +die() { printf '[channels] ERROR: %s\n' "$*" >&2; exit 1; } +log() { printf '[channels] %s\n' "$*" >&2; } + +require_release() { + local tag="$1" status + status="$(curl -fsS -o /dev/null -w "%{http_code}" \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${GITEA_SERVER}/api/v1/repos/${GITEA_REPO}/releases/tags/${tag}" \ + 2>/dev/null || echo "000")" + [[ "$status" == "200" ]] || die "no Gitea release for tag ${tag} (HTTP $status)" +} + +_auth="Authorization: token ${GITEA_TOKEN}" +_pkg_url="${GITEA_SERVER}/api/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}/channels.json" +_pkg_del="${GITEA_SERVER}/api/v1/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}" + +valid_channel() { case "$1" in current|previous) return 0 ;; *) return 1 ;; esac; } + +read_channels() { + local tmp status + tmp="$(mktemp)" + status="$(curl -fsS -o "$tmp" -w "%{http_code}" -H "$_auth" "$_pkg_url" 2>/dev/null || echo "000")" + case "$status" in + 200) jq -e . "$tmp" >/dev/null 2>&1 || die "invalid channels.json"; cat "$tmp" ;; + 404|000) printf '{}\n' ;; + *) die "read channels.json: HTTP $status" ;; + esac + rm -f "$tmp" +} + +write_channels() { + local json="$1" tmp + jq -e . <<<"$json" >/dev/null 2>&1 || die "refusing to write invalid channels.json" + tmp="$(mktemp)"; jq -S . <<<"$json" >"$tmp" + if [[ "$DRY_RUN" == "1" ]]; then + log "DRY_RUN: would write:"; jq -S . "$tmp" >&2; rm -f "$tmp"; return 0 + fi + curl -fsS -X DELETE -H "$_auth" "$_pkg_del" >/dev/null 2>&1 || true + curl -fsS -X PUT -H "$_auth" -H "Content-Type: application/octet-stream" \ + --data-binary "@$tmp" "$_pkg_url" >/dev/null || die "write failed" + rm -f "$tmp" + log "deployment-channels/sow-tools updated"; jq -S . <<<"$json" >&2 +} + +cmd="${1:-show}" +case "$cmd" in + show) read_channels | jq -S . ;; + set) + channel="${2:?}"; tag="${3:?}" + valid_channel "$channel" || die "unknown channel: $channel" + require_release "$tag" + write_channels "$(read_channels | jq --arg c "$channel" --arg t "$tag" '.[$c]=$t')" + ;; + release) + tag="${2:?}" + require_release "$tag" + write_channels "$(read_channels | jq --arg t "$tag" ' + (if .current then .previous = .current else . end) | .current = $t')" + ;; + *) die "usage: promote show | set | release " ;; +esac diff --git a/tests/promote-crucible-contract.sh b/tests/promote-crucible-contract.sh new file mode 100755 index 0000000..963e0d0 --- /dev/null +++ b/tests/promote-crucible-contract.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail +fail() { echo "FAIL: $*" >&2; exit 1; } +promote="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/scripts/promote-crucible.sh" +[[ -f "$promote" ]] || fail "promote-crucible.sh missing" +grep -q 'STREAM_NAME=crucible' "$promote" || fail "STREAM_NAME not crucible" +grep -q 'STREAM_TIER=service' "$promote" || fail "STREAM_TIER not service" +grep -q 'skopeo inspect' "$promote" || fail "require_release must use skopeo" +grep -q 'deployment/crucible' "$promote" || fail "wrong image path in skopeo" +echo "promote-crucible-contract: OK" diff --git a/tests/promote-sow-tools-contract.sh b/tests/promote-sow-tools-contract.sh new file mode 100755 index 0000000..4037a28 --- /dev/null +++ b/tests/promote-sow-tools-contract.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail +fail() { echo "FAIL: $*" >&2; exit 1; } +promote="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/scripts/promote-sow-tools.sh" +[[ -f "$promote" ]] || fail "promote-sow-tools.sh missing" +grep -q 'STREAM_NAME=sow-tools' "$promote" || fail "STREAM_NAME not sow-tools" +grep -q 'STREAM_TIER=service' "$promote" || fail "STREAM_TIER not service" +grep -q 'api/v1/repos' "$promote" || fail "require_release must use Gitea releases API" +grep -qv 'skopeo' "$promote" || fail "should not use skopeo (no registry images)" +echo "promote-sow-tools-contract: OK" -- 2.54.0 From bed1ff975f3fc960b7ad87510ff6fc859ddfa7d7 Mon Sep 17 00:00:00 2001 From: vickydotbat Date: Sat, 27 Jun 2026 20:22:21 +0200 Subject: [PATCH 2/2] revert: drop redundant utility channel promote --- .gitea/workflows/build-binaries.yml | 18 ------ .gitea/workflows/build-image.yml | 19 ------- scripts/promote-crucible.sh | 85 ----------------------------- scripts/promote-sow-tools.sh | 78 -------------------------- tests/promote-crucible-contract.sh | 10 ---- tests/promote-sow-tools-contract.sh | 10 ---- 6 files changed, 220 deletions(-) delete mode 100755 scripts/promote-crucible.sh delete mode 100755 scripts/promote-sow-tools.sh delete mode 100755 tests/promote-crucible-contract.sh delete mode 100755 tests/promote-sow-tools-contract.sh diff --git a/.gitea/workflows/build-binaries.yml b/.gitea/workflows/build-binaries.yml index f8235ff..c99d1e4 100644 --- a/.gitea/workflows/build-binaries.yml +++ b/.gitea/workflows/build-binaries.yml @@ -69,21 +69,3 @@ jobs: "${api}/releases/${id}/assets?name=$(basename "$f")" done ' - - - name: Promote channel - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - env: - TAG: ${{ github.ref_name }} - GITEA_TOKEN: ${{ secrets.PACKAGE_TOKEN }} - GITEA_SERVER: ${{ github.server_url }} - GITEA_OWNER: ${{ github.repository_owner }} - GITEA_REPO: ${{ github.repository }} - run: | - nix develop --command bash -c ' - set -euo pipefail - if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - bash scripts/promote-sow-tools.sh release "$TAG" - else - printf "unsupported tag for service tier: %s\n" "$TAG" >&2; exit 1 - fi - ' diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index 38b6cb5..6bfaeb7 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -50,22 +50,3 @@ jobs: bash scripts/emit-release-fragment.sh - uses: actions/upload-artifact@v3 with: { name: release-fragment, path: release-fragment.json } - - # Service tier: only vX.Y.Z → release; anything else rejects. - # SHA is the 12-char git SHA from the "Resolve tag" step above. - - name: Promote channel - env: - TAG: ${{ github.ref_name }} - SHA: ${{ steps.tag.outputs.sha }} - GITEA_TOKEN: ${{ secrets.PACKAGE_TOKEN }} - GITEA_SERVER: ${{ github.server_url }} - GITEA_OWNER: ${{ github.repository_owner }} - REGISTRY_HOST: ${{ env.REGISTRY }} - REGISTRY_USER: ${{ secrets.REGISTRY_USER }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - run: | - if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - nix shell nixpkgs#skopeo --command bash scripts/promote-crucible.sh release "$SHA" - else - printf 'unsupported tag for service tier: %s\n' "$TAG" >&2; exit 1 - fi diff --git a/scripts/promote-crucible.sh b/scripts/promote-crucible.sh deleted file mode 100755 index 042d6b0..0000000 --- a/scripts/promote-crucible.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash -# vendored from sow-platform/deploy/scripts/promote-gitea.sh — keep in sync -# Channel pointer for crucible registry images (service tier). -# channels.json values are the 12-char git SHAs used as image tags. -set -euo pipefail - -: "${GITEA_SERVER:?set GITEA_SERVER}" -: "${GITEA_TOKEN:?set GITEA_TOKEN}" -: "${GITEA_OWNER:?set GITEA_OWNER}" -: "${REGISTRY_HOST:?set REGISTRY_HOST}" -: "${REGISTRY_USER:?set REGISTRY_USER}" -: "${REGISTRY_PASSWORD:?set REGISTRY_PASSWORD}" - -STREAM_NAME=crucible -STREAM_TIER=service -DRY_RUN="${DRY_RUN:-0}" - -need() { command -v "$1" >/dev/null 2>&1 || { printf 'need: %s not found\n' "$1" >&2; exit 1; }; } -need jq curl skopeo -die() { printf '[channels] ERROR: %s\n' "$*" >&2; exit 1; } -log() { printf '[channels] %s\n' "$*" >&2; } - -require_release() { - local tag="$1" - skopeo inspect \ - --creds "${REGISTRY_USER}:${REGISTRY_PASSWORD}" \ - "docker://${REGISTRY_HOST}/deployment/crucible:${tag}" \ - >/dev/null 2>&1 \ - || die "no published image crucible:${tag}" -} - -# ---- promote-gitea.sh body (paste verbatim from sow-platform/deploy/scripts/promote-gitea.sh) ---- -_auth="Authorization: token ${GITEA_TOKEN}" -_pkg_url="${GITEA_SERVER}/api/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}/channels.json" -_pkg_del="${GITEA_SERVER}/api/v1/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}" - -valid_channel() { case "$1" in current|previous) return 0 ;; *) return 1 ;; esac; } - -read_channels() { - local tmp status - tmp="$(mktemp)" - status="$(curl -fsS -o "$tmp" -w "%{http_code}" -H "$_auth" "$_pkg_url" 2>/dev/null || echo "000")" - case "$status" in - 200) jq -e . "$tmp" >/dev/null 2>&1 || die "existing channels.json is invalid"; cat "$tmp" ;; - 404|000) printf '{}\n' ;; - *) die "read channels.json: HTTP $status" ;; - esac - rm -f "$tmp" -} - -write_channels() { - local json="$1" tmp - jq -e . <<<"$json" >/dev/null 2>&1 || die "refusing to write invalid channels.json" - tmp="$(mktemp)"; jq -S . <<<"$json" >"$tmp" - if [[ "$DRY_RUN" == "1" ]]; then - log "DRY_RUN: would write:"; jq -S . "$tmp" >&2; rm -f "$tmp"; return 0 - fi - curl -fsS -X DELETE -H "$_auth" "$_pkg_del" >/dev/null 2>&1 || true - curl -fsS -X PUT -H "$_auth" \ - -H "Content-Type: application/octet-stream" \ - --data-binary "@$tmp" \ - "$_pkg_url" >/dev/null || die "write channels.json failed" - rm -f "$tmp" - log "deployment-channels/crucible updated" - jq -S . <<<"$json" >&2 -} - -cmd="${1:-show}" -case "$cmd" in - show) read_channels | jq -S . ;; - set) - channel="${2:?usage: promote set }" - tag="${3:?usage: promote set }" - valid_channel "$channel" || die "unknown channel: $channel" - require_release "$tag" - write_channels "$(read_channels | jq --arg c "$channel" --arg t "$tag" '.[$c]=$t')" - ;; - release) - tag="${2:?usage: promote release }" - require_release "$tag" - write_channels "$(read_channels | jq --arg t "$tag" ' - (if .current then .previous = .current else . end) | .current = $t')" - ;; - *) die "usage: promote show | set | release " ;; -esac diff --git a/scripts/promote-sow-tools.sh b/scripts/promote-sow-tools.sh deleted file mode 100755 index f58f22a..0000000 --- a/scripts/promote-sow-tools.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash -# vendored from sow-platform/deploy/scripts/promote-gitea.sh — keep in sync -# Channel pointer for sow-tools binary releases (service tier). -# channels.json values are version tags (vX.Y.Z), not SHAs. -set -euo pipefail - -: "${GITEA_SERVER:?set GITEA_SERVER}" -: "${GITEA_TOKEN:?set GITEA_TOKEN}" -: "${GITEA_OWNER:?set GITEA_OWNER}" -: "${GITEA_REPO:?set GITEA_REPO}" - -STREAM_NAME=sow-tools -STREAM_TIER=service -DRY_RUN="${DRY_RUN:-0}" - -need() { command -v "$1" >/dev/null 2>&1 || { printf 'need: %s not found\n' "$1" >&2; exit 1; }; } -need jq curl -die() { printf '[channels] ERROR: %s\n' "$*" >&2; exit 1; } -log() { printf '[channels] %s\n' "$*" >&2; } - -require_release() { - local tag="$1" status - status="$(curl -fsS -o /dev/null -w "%{http_code}" \ - -H "Authorization: token ${GITEA_TOKEN}" \ - "${GITEA_SERVER}/api/v1/repos/${GITEA_REPO}/releases/tags/${tag}" \ - 2>/dev/null || echo "000")" - [[ "$status" == "200" ]] || die "no Gitea release for tag ${tag} (HTTP $status)" -} - -_auth="Authorization: token ${GITEA_TOKEN}" -_pkg_url="${GITEA_SERVER}/api/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}/channels.json" -_pkg_del="${GITEA_SERVER}/api/v1/packages/${GITEA_OWNER}/generic/deployment-channels/${STREAM_NAME}" - -valid_channel() { case "$1" in current|previous) return 0 ;; *) return 1 ;; esac; } - -read_channels() { - local tmp status - tmp="$(mktemp)" - status="$(curl -fsS -o "$tmp" -w "%{http_code}" -H "$_auth" "$_pkg_url" 2>/dev/null || echo "000")" - case "$status" in - 200) jq -e . "$tmp" >/dev/null 2>&1 || die "invalid channels.json"; cat "$tmp" ;; - 404|000) printf '{}\n' ;; - *) die "read channels.json: HTTP $status" ;; - esac - rm -f "$tmp" -} - -write_channels() { - local json="$1" tmp - jq -e . <<<"$json" >/dev/null 2>&1 || die "refusing to write invalid channels.json" - tmp="$(mktemp)"; jq -S . <<<"$json" >"$tmp" - if [[ "$DRY_RUN" == "1" ]]; then - log "DRY_RUN: would write:"; jq -S . "$tmp" >&2; rm -f "$tmp"; return 0 - fi - curl -fsS -X DELETE -H "$_auth" "$_pkg_del" >/dev/null 2>&1 || true - curl -fsS -X PUT -H "$_auth" -H "Content-Type: application/octet-stream" \ - --data-binary "@$tmp" "$_pkg_url" >/dev/null || die "write failed" - rm -f "$tmp" - log "deployment-channels/sow-tools updated"; jq -S . <<<"$json" >&2 -} - -cmd="${1:-show}" -case "$cmd" in - show) read_channels | jq -S . ;; - set) - channel="${2:?}"; tag="${3:?}" - valid_channel "$channel" || die "unknown channel: $channel" - require_release "$tag" - write_channels "$(read_channels | jq --arg c "$channel" --arg t "$tag" '.[$c]=$t')" - ;; - release) - tag="${2:?}" - require_release "$tag" - write_channels "$(read_channels | jq --arg t "$tag" ' - (if .current then .previous = .current else . end) | .current = $t')" - ;; - *) die "usage: promote show | set | release " ;; -esac diff --git a/tests/promote-crucible-contract.sh b/tests/promote-crucible-contract.sh deleted file mode 100755 index 963e0d0..0000000 --- a/tests/promote-crucible-contract.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -fail() { echo "FAIL: $*" >&2; exit 1; } -promote="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/scripts/promote-crucible.sh" -[[ -f "$promote" ]] || fail "promote-crucible.sh missing" -grep -q 'STREAM_NAME=crucible' "$promote" || fail "STREAM_NAME not crucible" -grep -q 'STREAM_TIER=service' "$promote" || fail "STREAM_TIER not service" -grep -q 'skopeo inspect' "$promote" || fail "require_release must use skopeo" -grep -q 'deployment/crucible' "$promote" || fail "wrong image path in skopeo" -echo "promote-crucible-contract: OK" diff --git a/tests/promote-sow-tools-contract.sh b/tests/promote-sow-tools-contract.sh deleted file mode 100755 index 4037a28..0000000 --- a/tests/promote-sow-tools-contract.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -fail() { echo "FAIL: $*" >&2; exit 1; } -promote="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/scripts/promote-sow-tools.sh" -[[ -f "$promote" ]] || fail "promote-sow-tools.sh missing" -grep -q 'STREAM_NAME=sow-tools' "$promote" || fail "STREAM_NAME not sow-tools" -grep -q 'STREAM_TIER=service' "$promote" || fail "STREAM_TIER not service" -grep -q 'api/v1/repos' "$promote" || fail "require_release must use Gitea releases API" -grep -qv 'skopeo' "$promote" || fail "should not use skopeo (no registry images)" -echo "promote-sow-tools-contract: OK" -- 2.54.0