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
@@ -30,6 +30,11 @@ on:
type: choice
options: [unchanged, 'off', compare, 'on']
default: unchanged
media_library_hero_photos:
description: 'Hero photos in the media library on the TEST deploys (Media__Library__HeroPhotosInLibrary in shared/env): unchanged, on or off. Needs the copy and the library check first.'
type: choice
options: [unchanged, 'on', 'off']
default: unchanged
pull_request:
types: [opened, synchronize, reopened]
push:
@@ -573,6 +578,7 @@ jobs:
media_library_copy: ${{ github.event.inputs.media_library_copy || 'unchanged' }}
media_library_dual_write: ${{ github.event.inputs.media_library_dual_write || 'unchanged' }}
media_library_read: ${{ github.event.inputs.media_library_read || 'unchanged' }}
media_library_hero_photos: ${{ github.event.inputs.media_library_hero_photos || 'unchanged' }}
# Production deploy ONLY on an explicit workflow_dispatch run with deploy_sls_production checked, and
# only when that run is on a release/* branch (same rule as ASF) — never reachable from a plain push
@@ -703,6 +709,7 @@ jobs:
media_library_copy: ${{ github.event.inputs.media_library_copy || 'unchanged' }}
media_library_dual_write: ${{ github.event.inputs.media_library_dual_write || 'unchanged' }}
media_library_read: ${{ github.event.inputs.media_library_read || 'unchanged' }}
media_library_hero_photos: ${{ github.event.inputs.media_library_hero_photos || 'unchanged' }}
# --- Smoke tests of the deployed compositions (anonymous requests, see scripts/smoke-site.sh) ---
# The CI tests the master CMS; this is the check that the composition of each site that was just deployed to test
+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