Update rehearsal: downgrade check for deploys, -N versions, failed logs

coreapp deploy refuses a lower version than the installed one without
--downgrade, as coreapp install does. Versions with -N (the Coreapp's own
fix on the same upstream version) order after the upstream one, for
releases too. A failed start keeps the container's whole log, from its
first start, in <name>-failed-start.log. coreapp status shows the
installed version beside the folder's.

Skill: references/updating.md (versions, what to check between versions,
testing an update over real data and its rollback, no copy after a
successful update); reading the installer's bash -x log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-04 14:06:31 -07:00
co-authored by Claude Opus 5.5
parent 491af8745f
commit 0aa334d22a
8 changed files with 168 additions and 18 deletions
+8 -6
View File
@@ -6,7 +6,7 @@
# coreapp new [--postgres | --mysql] [--sso] [--email] <name>
# make a new app in ./<name> (with its own database,
# sign-in through the Core's Authelia, sending mail)
# coreapp deploy [--recreate] [--drop-database]
# coreapp deploy [--recreate] [--drop-database] [--downgrade]
# build, copy to the Core, install or update
# (--recreate: a new container even if nothing
# changed; --drop-database: allow dropping
@@ -248,12 +248,13 @@ cmd_new() {
# --- deploy -----------------------------------------------------------------
cmd_deploy() {
local plan state tier answer local_id core_id dropped addon="" recreate="" dropdb=""
local plan state tier answer local_id core_id dropped addon="" recreate="" dropdb="" downgrade=""
while [[ $# -gt 0 ]]; do
case "$1" in
--recreate) recreate=--recreate ;;
--drop-database) dropdb=--drop-database ;;
*) die "Usage: coreapp deploy [--recreate] [--drop-database]" ;;
--downgrade) downgrade=--downgrade ;;
*) die "Usage: coreapp deploy [--recreate] [--drop-database] [--downgrade]" ;;
esac
shift
done
@@ -264,7 +265,7 @@ cmd_deploy() {
echo "Updating the installer on the Core ($REMOTE_INSTALLER)..."
sync_installer
# What installing would do (and whether the Core refuses it: name taken...)
plan="$(installer plan $dropdb)" || exit 1
plan="$(installer plan $dropdb $downgrade)" || exit 1
state="$(sed -n 's/^state=//p' <<< "$plan")"
tier="$(sed -n 's/^tier=//p' <<< "$plan")"
dropped="$(sed -n 's/^dropped_needs=//p' <<< "$plan")"
@@ -301,7 +302,7 @@ cmd_deploy() {
# Install, or update (which recreates the container if the image changed,
# even under the same version)
installer install $addon $recreate $dropdb || exit 1
installer install $addon $recreate $dropdb $downgrade || exit 1
[[ "$state" == new ]] && echo "(coreapp check tests it at its public address, as people reach it.)"
return 0
}
@@ -343,7 +344,8 @@ cmd_status() {
local address
core "docker ps -a --filter name='^$NAME\$' --format 'Container: {{.Names}} {{.Status}} image {{.Image}}'
[ -n \"\$(docker ps -aq --filter name='^$NAME\$')\" ] || echo 'Not installed on the Core.'"
echo "App: $TITLE $(image)"
echo "This folder: $TITLE $(image)"
echo "Installed version: $(core "sed -n 's/^IMAGE_VERSION=//p' /federated/apps/$NAME/.env 2> /dev/null || true")"
address="$(core "sed -n 's/^INTERNAL_IP=//p' /federated/services/$NAME/service 2> /dev/null || true")"
[[ -z "$address" ]] || echo "Address on the Core: $address, port $PORT"
echo "Needs: ${NEEDS:-nothing}"