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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user