Add deploy dry-run mode
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user