feat: add rsync deploy script with documentation

This commit is contained in:
2026-02-07 17:55:12 +01:00
parent 39ab822fd2
commit a5995857e8
2 changed files with 67 additions and 1 deletions

49
deploy.sh Executable file
View File

@@ -0,0 +1,49 @@
#!/bin/bash
# deploy.sh - Deploy dgray.io to production server via rsync
#
# Usage: ./deploy.sh [user@host] [remote-path]
# Example: ./deploy.sh admin@dgray.io /home/admin/web/dgray.io/public_html
#
# Prerequisites:
# - SSH key authentication configured
# - rsync installed locally and on server
set -e
# --- Configuration ---
REMOTE_USER_HOST="${1:-admin@dgray.io}"
REMOTE_PATH="${2:-/home/admin/web/dgray.io/public_html}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Files/directories to exclude from deployment
EXCLUDES=(
".git"
".gitignore"
"AGENTS.md"
"deploy.sh"
"docs/"
"tests/"
"README.md"
".vscode"
".idea"
)
# --- Build exclude arguments ---
EXCLUDE_ARGS=""
for item in "${EXCLUDES[@]}"; do
EXCLUDE_ARGS="$EXCLUDE_ARGS --exclude=$item"
done
# --- Deploy ---
echo "Deploying dgray.io"
echo " From: $SCRIPT_DIR"
echo " To: $REMOTE_USER_HOST:$REMOTE_PATH"
echo ""
rsync -avz --delete \
$EXCLUDE_ARGS \
"$SCRIPT_DIR/" \
"$REMOTE_USER_HOST:$REMOTE_PATH/"
echo ""
echo "Deploy complete."