feat: add deployment automation scripts

This commit is contained in:
2025-12-27 15:42:26 +11:00
parent 87f1711cbd
commit 33b2b708f4
9 changed files with 951 additions and 0 deletions

21
setup-cron.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Get the absolute path to the sync script
SYNC_SCRIPT="$(pwd)/sync-and-restart.sh"
# Make scripts executable
chmod +x deploy.sh
chmod +x sync-and-restart.sh
# Add cron job to run every 5 minutes
# We use a temporary file to avoid messing up existing crontab
crontab -l > mycron
# Check if the job already exists to avoid duplicates
if grep -q "$SYNC_SCRIPT" mycron; then
echo "Cron job already exists."
else
echo "*/5 * * * * $SYNC_SCRIPT >> $(pwd)/cron.log 2>&1" >> mycron
crontab mycron
echo "Cron job added."
fi
rm mycron