feat: add sync/pull/push scripts for Caddyfile management
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Push local Caddyfile changes to Gitea
|
||||
set -e
|
||||
|
||||
REPO_DIR="$HOME/admin/environment"
|
||||
cd "$REPO_DIR"
|
||||
|
||||
echo "[push-caddy] Copying local Caddyfile to repo..."
|
||||
echo "# Auto-synced from ~/momentry/etc/Caddyfile" > caddy/m4mini.Caddyfile
|
||||
cat ~/momentry/etc/Caddyfile >> caddy/m4mini.Caddyfile
|
||||
|
||||
git add caddy/m4mini.Caddyfile
|
||||
if git diff --cached --quiet; then
|
||||
echo "[push-caddy] No changes"
|
||||
else
|
||||
git commit -m "update: m4mini Caddyfile $(date +%Y-%m-%d)"
|
||||
git push origin main
|
||||
echo "[push-caddy] Pushed to Gitea"
|
||||
fi
|
||||
Reference in New Issue
Block a user