Add deploy dry-run mode

This commit is contained in:
2026-06-23 11:47:49 +02:00
parent e108a5e78b
commit ab3a40f835
2 changed files with 26 additions and 1 deletions
+22
View File
@@ -2,6 +2,22 @@
set -euo pipefail
dry_run=false
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run)
dry_run=true
;;
*)
echo "Unbekanntes Argument: $1" >&2
echo "Verwendung: $0 [--dry-run]" >&2
exit 1
;;
esac
shift
done
repo_root="$(cd "$(dirname "$0")/.." && pwd)"
config_file="$repo_root/.deploy.env"
include_file="${DEPLOY_INCLUDE_FILE:-$repo_root/scripts/deploy-include.txt}"
@@ -73,6 +89,12 @@ for item in "${deploy_items[@]}"; do
fi
done
if [[ "$dry_run" == true ]]; then
echo "Dry-Run: folgende SFTP-Befehle wuerden ausgefuehrt:"
cat "$batch_file"
exit 0
fi
cd "$repo_root"
sftp -P "$deploy_port" "$DEPLOY_USER@$DEPLOY_HOST" < "$batch_file"