fix(ci): use rsync to sync only stacks/ without polluting /srv/seedbox
- Clone repo to temp directory - Rsync only seedbox/stacks/ to /srv/seedbox/stacks/ - Preserve .env and volume data directories
This commit is contained in:
@@ -51,9 +51,20 @@ jobs:
|
|||||||
set -e
|
set -e
|
||||||
cd /srv/seedbox
|
cd /srv/seedbox
|
||||||
|
|
||||||
echo "=== Pulling latest changes ==="
|
echo "=== Syncing stacks from repository ==="
|
||||||
git fetch origin main
|
# Clone to temp directory and sync only seedbox/ content
|
||||||
git reset --hard origin/main
|
TEMP_DIR=$(mktemp -d)
|
||||||
|
git clone --depth 1 --branch main https://gitea.arnodo.fr/Damien/infra-scripts.git "$TEMP_DIR"
|
||||||
|
|
||||||
|
# Sync stacks directory (preserve .env and volumes)
|
||||||
|
rsync -av --delete \
|
||||||
|
--exclude='.env' \
|
||||||
|
--exclude='*/data/' \
|
||||||
|
--exclude='*/state/' \
|
||||||
|
"$TEMP_DIR/seedbox/stacks/" /srv/seedbox/stacks/
|
||||||
|
|
||||||
|
# Clean up temp directory
|
||||||
|
rm -rf "$TEMP_DIR"
|
||||||
|
|
||||||
echo "=== Creating .env file ==="
|
echo "=== Creating .env file ==="
|
||||||
cat > .env << 'ENVEOF'
|
cat > .env << 'ENVEOF'
|
||||||
|
|||||||
Reference in New Issue
Block a user