rdy for deploy

This commit is contained in:
nik
2025-09-22 21:49:44 +03:00
parent a1735f2e62
commit 4be1167058

View File

@@ -4,8 +4,9 @@ HOST="${1:-}"
DEST="${2:-}"
TMP="/tmp/masha_site_$(date +%s)"
mkdir -p "$TMP"
cp -a index.html "$TMP/"
cp -a index.html "$TMP/index.html"
ssh -o StrictHostKeyChecking=no "$HOST" "mkdir -p '$DEST'"
rsync -az --delete "$TMP/"/ "$HOST":"$DEST"/
scp -q "$TMP/index.html" "$HOST":"$DEST/.index.html.new"
ssh -o StrictHostKeyChecking=no "$HOST" "mv '$DEST/.index.html.new' '$DEST/index.html'"
rm -rf "$TMP"