1
0
mirror of git://f0xx.org/ac/ac-deploy synced 2026-08-12 18:12:19 +03:00

Deploy: stop rsync --delete from wiping builder builds/ artifacts.

Exclude builds/ and .docker from broadcast sync; re-run prepare-be-builder-dirs
after deploy so nobody retains write access to artifact trees.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-08-09 11:03:38 +02:00
parent be7f1b0492
commit 057568974d
2 changed files with 23 additions and 2 deletions

View File

@@ -21,10 +21,12 @@ else
fi
log "deploy ac-ms-broadcast → ${BROADCAST_DEST}"
mkdir -p "$BROADCAST_DEST"
mkdir -p "$BROADCAST_DEST/builds" "$BROADCAST_DEST/.docker"
rsync -a --delete \
--exclude='.git' \
--exclude='config/config.php' \
--exclude='builds/' \
--exclude='.docker/' \
"${BROADCAST_SRC}/" "${BROADCAST_DEST}/" 2>/dev/null || \
{ mkdir -p "$BROADCAST_DEST"; cp -r "${BROADCAST_SRC}/." "${BROADCAST_DEST}/"; }
@@ -66,6 +68,16 @@ return [
PHPEOF
chown -R nginx:nginx "$BROADCAST_DEST" 2>/dev/null || true
# Preserve builder artifact ownership (PHP-FPM user nobody).
PREP="${ROOT}/lab-seeds/backend/scripts/prepare-be-builder-dirs.sh"
if [ -f "$PREP" ]; then
sh "$PREP" "$BROADCAST_DEST"
else
chown nobody:nginx "$BROADCAST_DEST/builds" 2>/dev/null || true
chmod 2775 "$BROADCAST_DEST/builds" 2>/dev/null || true
chown nobody:nobody "$BROADCAST_DEST/.docker" 2>/dev/null || true
chmod 775 "$BROADCAST_DEST/.docker" 2>/dev/null || true
fi
# DB schema + user — primary node only
if is_primary_node; then