#!/usr/bin/env bash # Promote an already-built set of images to a new tag WITHOUT rebuilding, by copying the # registry manifest. Guarantees production runs the exact bytes staging tested. Runs on the # CI runner. Fails clearly if the source tag does not exist (e.g. the commit was never built # on the default branch before being tagged). # # Required environment: # REGISTRY image name prefix, e.g. gitea.example.tld/luka # SRC_TAG existing tag to promote from, e.g. sha-abc1234 # DST_TAG new tag to create, e.g. v1.2.3 set -euo pipefail : "${REGISTRY:?}" "${SRC_TAG:?}" "${DST_TAG:?}" for name in termportal-express termportal-opensearch termportal-concordancer; do ref="$REGISTRY/$name" echo "+ promote $ref:$SRC_TAG -> :$DST_TAG" >&2 docker buildx imagetools create --tag "$ref:$DST_TAG" "$ref:$SRC_TAG" done