Fase 2 stap A: write-through van de Hero naar de bibliotheek (schakelaar uit), per-slide uitsnede en set in de bibliotheek
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,11 @@ on:
|
||||
type: choice
|
||||
options: [unchanged, 'on', 'off']
|
||||
default: unchanged
|
||||
media_library_dual_write:
|
||||
description: 'Media library write-through on the TEST deploys (Media__Library__DualWrite in shared/env): unchanged, on or off'
|
||||
type: choice
|
||||
options: [unchanged, 'on', 'off']
|
||||
default: unchanged
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
push:
|
||||
@@ -561,6 +566,7 @@ jobs:
|
||||
health_check_url: ${{ vars.HEALTH_CHECK_URL_TEST }}
|
||||
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' }}
|
||||
|
||||
# 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
|
||||
@@ -689,6 +695,7 @@ jobs:
|
||||
health_check_url: ${{ vars.HEALTH_CHECK_URL_ASF_TEST }}
|
||||
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' }}
|
||||
|
||||
# --- 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
|
||||
|
||||
@@ -42,6 +42,11 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: unchanged
|
||||
media_library_dual_write:
|
||||
description: 'unchanged | on | off: sets Media__Library__DualWrite (the write-through of phase 2) in shared/env before the restart. TEST only, never production.'
|
||||
required: false
|
||||
type: string
|
||||
default: unchanged
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
@@ -247,6 +252,33 @@ jobs:
|
||||
fi
|
||||
echo "Media__Library__CopyOnStartup is now: $(rssh "grep '^Media__Library__CopyOnStartup=' $ENV_FILE || echo '(not set = off)'")"
|
||||
|
||||
# The write-through switch of phase 2 (same rules as the copy switch above: only this one key of shared/env, only on test,
|
||||
# only on, off or unchanged). `on` makes every change of the hero also land in the library's tables.
|
||||
- name: Set the media library write-through switch (test only)
|
||||
if: inputs.media_library_dual_write != '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_dual_write }}"
|
||||
if [ "${{ inputs.environment }}" != "test" ]; then
|
||||
echo "The media library write-through switch is for the test environment only (environment: ${{ inputs.environment }})." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ "$MODE" != "on" ] && [ "$MODE" != "off" ]; then
|
||||
echo "media_library_dual_write 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__DualWrite=/d' $ENV_FILE && echo 'Media__Library__DualWrite=true' >> $ENV_FILE"
|
||||
else
|
||||
rssh "touch $ENV_FILE && sed -i '/^Media__Library__DualWrite=/d' $ENV_FILE"
|
||||
fi
|
||||
echo "Media__Library__DualWrite is now: $(rssh "grep '^Media__Library__DualWrite=' $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
|
||||
|
||||
Reference in New Issue
Block a user