Prepare immutable release recovery automation and deployment safeguards

This commit is contained in:
2026-11-26 02:05:13 -05:00
parent 151c59564d
commit 799a377cc0
8 changed files with 773 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euo pipefail
SSH_KEY="$HOME/.ssh/ssw590_digitalocean"
HOST="root@git.nageshwaran.dev"
ssh -T \
-o BatchMode=yes \
-o StrictHostKeyChecking=yes \
-o ConnectTimeout=10 \
-o ServerAliveInterval=10 \
-o ServerAliveCountMax=3 \
-i "$SSH_KEY" \
"$HOST" \
'bash -c "
set -eu
exec 9>/run/lock/chapter6-production.lock
if ! flock -n 9; then
echo LOCK_BUSY
exit 75
fi
echo PRODUCTION_LOCK_ACQUIRED
date -u
while IFS= read -r command; do
if [ \"\$command\" = RELEASE ]; then
echo PRODUCTION_LOCK_RELEASED
exit 0
fi
done
"'