merge dispatch and deploy into a single deploy.sh
deploy.sh reads SSH_ORIGINAL_COMMAND directly, validates it, and runs the deploy. No more dispatch indirection.
This commit is contained in:
+9
-1
@@ -1,6 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
APP="${1#deploy-}"
|
||||
|
||||
CMD="${SSH_ORIGINAL_COMMAND:-${1:-}}"
|
||||
|
||||
if ! [[ "$CMD" =~ ^deploy-[a-zA-Z0-9._-]+$ ]]; then
|
||||
echo "Unknown command: $CMD"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
APP="${CMD#deploy-}"
|
||||
cd /opt/hantim
|
||||
git pull
|
||||
cd "docker/$APP"
|
||||
|
||||
Reference in New Issue
Block a user