release.sh: release deployed the OLD image — pin the built tag, then deploy
The release chain read the tag back from CloudronManifest.json BEFORE pinning it, so t was always the previous tag: release built the new image, then deployed the old one and printed success — the exact silent no-op this script exists to prevent. Its usage text promises build -> pin -> deploy -> verify; it did build -> deploy. cmd_build now exports the tag it built and release pins THAT, then deploys and verifies. Not exercised end-to-end yet (the theme deploy that found this bug was run as separate build/pin/deploy steps and passed all checks); the edit is syntax-checked only.
This commit is contained in:
1 parent
fb1b6fd86e
commit
1b9b971c6e
1 file changed
+2
-1
+2
-1
@@ -54,6 +54,7 @@ cmd_build() {
|
|||||||
# BuildKit does the work (no docker on the caller). What is required is a
|
# BuildKit does the work (no docker on the caller). What is required is a
|
||||||
# registry login for this user on this host — env token or builder config.
|
# registry login for this user on this host — env token or builder config.
|
||||||
local tag="${TAG:-$(date -u +%Y%m%d)-$(git rev-parse --short HEAD)}"
|
local tag="${TAG:-$(date -u +%Y%m%d)-$(git rev-parse --short HEAD)}"
|
||||||
|
OVERLAY_LAST_TAG="$tag" # for the `release` chain: pin THIS, not the manifest's stale tag
|
||||||
[ -z "$(git status --porcelain)" ] || die "working tree is dirty — commit first, the tag carries the git sha"
|
[ -z "$(git status --porcelain)" ] || die "working tree is dirty — commit first, the tag carries the git sha"
|
||||||
|
|
||||||
local logged_in=0
|
local logged_in=0
|
||||||
@@ -186,6 +187,6 @@ case "${1:-}" in
|
|||||||
deploy) shift; cmd_deploy "$@" ;;
|
deploy) shift; cmd_deploy "$@" ;;
|
||||||
verify) shift; cmd_verify "$@" ;;
|
verify) shift; cmd_verify "$@" ;;
|
||||||
volume) shift; cmd_volume "$@" ;;
|
volume) shift; cmd_volume "$@" ;;
|
||||||
release) shift; cmd_build "$@"; t=$(manifest_tag); cmd_deploy ;;
|
release) shift; cmd_build "$@"; cmd_pin "$OVERLAY_LAST_TAG"; cmd_deploy; cmd_verify ;;
|
||||||
*) sed -n '2,30p' "$0" | sed 's/^# \{0,1\}//' ; exit 1 ;;
|
*) sed -n '2,30p' "$0" | sed 's/^# \{0,1\}//' ; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
Reference in new issue
Block a user