Files
KX-Bridge-Release/docker-publish-testing.sh
2026-08-25 13:27:36 +02:00

36 lines
1.2 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# docker-publish-testing.sh lokaler Docker-Build+Push für den Testing-Kanal.
#
# Ersatz für .gitea/workflows/testing.yml: baut & pusht
# gitea.it-drui.de/viewit/kx-bridge:testing + :testing-<shortsha>
# direkt vom aktuellen HEAD des testing-Branches. Bewusst kein Teil von release.sh
# (kein Versions-Argument, kein Changelog, kein Tag, kein Branch-Writeback Testing-
# Pushes sind commit-getrieben/ad-hoc, wie es testing.yml auch schon war).
#
# Verwendung:
# ./docker-publish-testing.sh
#
# Voraussetzung: einmalig `docker login gitea.it-drui.de` (siehe release_lib.sh).
set -euo pipefail
DEV_REPO="$(cd "$(dirname "$0")" && pwd)"
cd "$DEV_REPO"
source "$DEV_REPO/release_lib.sh"
CUR_BRANCH=$(git branch --show-current)
[[ "$CUR_BRANCH" == "testing" ]] || error "Muss auf 'testing'-Branch sein (aktuell: $CUR_BRANCH)"
VERSION="testing-$(git rev-parse --short HEAD)"
info "Testing-Version: $VERSION"
# VERSION nur im Workspace setzen (kein Commit) wie testing.yml es tat.
echo "$VERSION" > VERSION
docker_build_push "$VERSION" "testing" "$VERSION"
# Workspace wieder sauber hinterlassen.
git checkout -- VERSION 2>/dev/null || true
success "Testing-Build fertig: gitea.it-drui.de/viewit/kx-bridge:testing + :$VERSION"