fix(deploy): make seed-data.sh recursive for directory entries
Some checks are pending
ci / vet + build (push) Waiting to run
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions

The Restreamer UI bundle includes subdirectories (_player,
_playersite, static, locales) and the Dockerfile copies the whole
tree into /core/static. seed-data.sh on first boot was using flat
'cp -p' which errors on directories with 'omitting directory ...';
set -e then exits, the container restarts forever in a crash loop,
and Core never starts.

Fix: 'cp -Rp' so directories are copied as trees. The no-clobber
check on the top-level name still keeps operator-edited content
safe — if /core/data/_player exists we don't replace it, even if
its internals diverge from the bundled version.

Also defends against dotfiles via the second glob.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Zac Gaetano 2026-05-03 13:01:51 +00:00
parent 26991ec463
commit 10f3e20a6a

View file

@ -23,11 +23,15 @@ if [ ! -d "$DST" ]; then
mkdir -p "$DST"
fi
for f in "$SRC"/*; do
# Iterate over both files and directories. The Restreamer UI bundle
# ships subdirectories (_player, _playersite, static) so this needs
# the recursive flag; the no-clobber check on the top-level name keeps
# operator-edited content safe.
for f in "$SRC"/* "$SRC"/.[!.]*; do
[ -e "$f" ] || continue
name=$(basename "$f")
if [ ! -e "$DST/$name" ]; then
cp -p "$f" "$DST/$name"
cp -Rp "$f" "$DST/$name"
echo "seed-data: copied $name -> $DST/$name"
fi
done