Fase 3b: de Hero bewaart zijn foto's in de bibliotheektabel (schakelaar uit), HeroImages blijft een kopie, controle bij het opstarten, FK-migratie met Down

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 00:10:58 +01:00
co-authored by Claude Sonnet 5.5
parent 53e1e3c8a6
commit 7246efccc1
18 changed files with 957 additions and 11 deletions
+33
View File
@@ -52,6 +52,11 @@ on:
required: false
type: string
default: unchanged
media_library_hero_photos:
description: 'unchanged | on | off: sets Media__Library__HeroPhotosInLibrary (phase 3b: the hero photos live in the library table) in shared/env before the restart. TEST only, never production.'
required: false
type: string
default: unchanged
jobs:
deploy:
@@ -311,6 +316,34 @@ jobs:
fi
echo "Media__Library__ReadFromLibrary is now: $(rssh "grep '^Media__Library__ReadFromLibrary=' $ENV_FILE || echo '(not set = off)'")"
# The hero-photos storage switch of phase 3b (same rules as the switches above). `on` makes the hero keep its photos in the
# library's MediaAssets table (HeroImages stays a copy so it can go back); the application REFUSES to start when the library
# does not yet hold every hero photo, so run the copy first and check it with the library check.
- name: Set the media library hero photos switch (test only)
if: inputs.media_library_hero_photos != 'unchanged'
env:
SSH_USER: ${{ secrets.PI_MAIN_USERNAME }}
SSH_PASS: ${{ secrets.PI_MAIN_PASSWORD }}
SSH_PORT: ${{ secrets.PI_MAIN_PORT }}
SSH_HOST: ${{ secrets.PI_MAIN_ADDRESS }}
run: |
MODE="${{ inputs.media_library_hero_photos }}"
if [ "${{ inputs.environment }}" != "test" ]; then
echo "The hero photos switch is for the test environment only (environment: ${{ inputs.environment }})." >&2
exit 1
fi
if [ "$MODE" != "on" ] && [ "$MODE" != "off" ]; then
echo "media_library_hero_photos must be unchanged, on or off (got: $MODE)." >&2
exit 1
fi
ENV_FILE="${{ inputs.deploy_path }}/shared/env"
if [ "$MODE" = "on" ]; then
rssh "touch $ENV_FILE && sed -i '/^Media__Library__HeroPhotosInLibrary=/d' $ENV_FILE && echo 'Media__Library__HeroPhotosInLibrary=true' >> $ENV_FILE"
else
rssh "touch $ENV_FILE && sed -i '/^Media__Library__HeroPhotosInLibrary=/d' $ENV_FILE"
fi
echo "Media__Library__HeroPhotosInLibrary is now: $(rssh "grep '^Media__Library__HeroPhotosInLibrary=' $ENV_FILE || echo '(not set = off)'")"
# Atomic release switch (FR-06, D-27): `ln -sfn` replaces the `current` symlink target in a
# single filesystem operation, so there is no moment where `current` points at a half-written
# directory. The process is then restarted so it picks up the new assemblies — a running .NET