fix(deploy): exclude macOS AppleDouble files from deploy archive

When tar runs on macOS it embeds ._* resource-fork sidecars next to each
file. These ended up under l4d2web/alembic/versions/ on the target and
alembic tried to import them as migration modules, failing with
"source code string cannot contain null bytes". Set COPYFILE_DISABLE=1
and add an --exclude '._*' so the archive is portable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mwiegand 2026-05-07 00:58:29 +02:00
parent 0210ecd301
commit 7d9939c71d
No known key found for this signature in database

View file

@ -21,13 +21,14 @@ cleanup() {
} }
trap cleanup EXIT INT HUP TERM trap cleanup EXIT INT HUP TERM
tar -czf "$archive" \ COPYFILE_DISABLE=1 tar -czf "$archive" \
--exclude .git \ --exclude .git \
--exclude .venv \ --exclude .venv \
--exclude __pycache__ \ --exclude __pycache__ \
--exclude .pytest_cache \ --exclude .pytest_cache \
--exclude '*.egg-info' \ --exclude '*.egg-info' \
--exclude 'l4d2web.db*' \ --exclude 'l4d2web.db*' \
--exclude '._*' \
-C "$repo_root" . -C "$repo_root" .
remote_tmp=$(ssh "$target" 'mktemp -d') remote_tmp=$(ssh "$target" 'mktemp -d')