Fix deploy dry-run flag and generalize env example
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
# Copy this file to scripts/.deploy.env and fill in your values.
|
# Copy this file to scripts/.deploy.env and fill in your values.
|
||||||
DEPLOY_HOST="root@example.com"
|
DEPLOY_HOST="USER@HOST"
|
||||||
DEPLOY_TARGET="/home/user/web/xmrpay.link/public_html"
|
DEPLOY_TARGET="/home/USER/web/xmrpay.link/public_html"
|
||||||
|
|
||||||
# Optional hardening settings:
|
# Optional hardening settings:
|
||||||
# DEPLOY_BACKUP_ENABLE="1"
|
# DEPLOY_BACKUP_ENABLE="1"
|
||||||
# DEPLOY_BACKUP_KEEP="14"
|
# DEPLOY_BACKUP_KEEP="14"
|
||||||
# DEPLOY_BACKUP_DIR="/home/user/web/xmrpay.link/backups/xmrpay-data"
|
# DEPLOY_BACKUP_DIR="/home/USER/web/xmrpay.link/backups/xmrpay-data"
|
||||||
# DEPLOY_DRY_RUN="0"
|
# DEPLOY_DRY_RUN="0"
|
||||||
|
|||||||
@@ -68,14 +68,14 @@ else
|
|||||||
echo "Skipping pre-deploy backup (DEPLOY_BACKUP_ENABLE=0)."
|
echo "Skipping pre-deploy backup (DEPLOY_BACKUP_ENABLE=0)."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RSYNC_DRY_RUN=()
|
RSYNC_DRY_RUN=""
|
||||||
if [[ "$DRY_RUN" == "1" ]]; then
|
if [[ "$DRY_RUN" == "1" ]]; then
|
||||||
RSYNC_DRY_RUN+=("--dry-run")
|
RSYNC_DRY_RUN="--dry-run"
|
||||||
echo "Running in dry-run mode (DEPLOY_DRY_RUN=1)."
|
echo "Running in dry-run mode (DEPLOY_DRY_RUN=1)."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rsync -avz --delete \
|
rsync -avz --delete \
|
||||||
"${RSYNC_DRY_RUN[@]}" \
|
${RSYNC_DRY_RUN} \
|
||||||
--exclude '.git' \
|
--exclude '.git' \
|
||||||
--exclude 'node_modules' \
|
--exclude 'node_modules' \
|
||||||
--exclude 'data/' \
|
--exclude 'data/' \
|
||||||
|
|||||||
Reference in New Issue
Block a user