Fase 2 stap C: leesschakelaar (off/compare/on) voor het bibliotheekscherm, read-check endpoint, workflow-input

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 23:25:14 +01:00
co-authored by Claude Sonnet 5.5
parent 3558e91fde
commit e1010007fa
16 changed files with 633 additions and 6 deletions
@@ -25,6 +25,11 @@ on:
type: choice
options: [unchanged, 'on', 'off']
default: unchanged
media_library_read:
description: 'Media library read switch on the TEST deploys (Media__Library__ReadFromLibrary in shared/env): unchanged, off, compare or on'
type: choice
options: [unchanged, 'off', compare, 'on']
default: unchanged
pull_request:
types: [opened, synchronize, reopened]
push:
@@ -567,6 +572,7 @@ jobs:
run_db_backup: false
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' }}
# 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
@@ -696,6 +702,7 @@ jobs:
run_db_backup: false
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' }}
# --- 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
+32
View File
@@ -47,6 +47,11 @@ on:
required: false
type: string
default: unchanged
media_library_read:
description: 'unchanged | off | compare | on: sets Media__Library__ReadFromLibrary (the read switch of phase 2) in shared/env before the restart. TEST only, never production.'
required: false
type: string
default: unchanged
jobs:
deploy:
@@ -279,6 +284,33 @@ jobs:
fi
echo "Media__Library__DualWrite is now: $(rssh "grep '^Media__Library__DualWrite=' $ENV_FILE || echo '(not set = off)'")"
# The read switch of phase 2 (same rules as the switches above): compare = the library tables are read too and differences are
# logged and shown by GET media-library/read-check; on = the library screen reads the library tables (needs the write-through).
- name: Set the media library read switch (test only)
if: inputs.media_library_read != '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_read }}"
if [ "${{ inputs.environment }}" != "test" ]; then
echo "The media library read switch is for the test environment only (environment: ${{ inputs.environment }})." >&2
exit 1
fi
if [ "$MODE" != "on" ] && [ "$MODE" != "off" ] && [ "$MODE" != "compare" ]; then
echo "media_library_read must be unchanged, off, compare or on (got: $MODE)." >&2
exit 1
fi
ENV_FILE="${{ inputs.deploy_path }}/shared/env"
if [ "$MODE" = "off" ]; then
rssh "touch $ENV_FILE && sed -i '/^Media__Library__ReadFromLibrary=/d' $ENV_FILE"
else
rssh "touch $ENV_FILE && sed -i '/^Media__Library__ReadFromLibrary=/d' $ENV_FILE && echo 'Media__Library__ReadFromLibrary=$MODE' >> $ENV_FILE"
fi
echo "Media__Library__ReadFromLibrary is now: $(rssh "grep '^Media__Library__ReadFromLibrary=' $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