mirror of
https://github.com/DeNNiiInc/Advanced-Raid-Calculator.git
synced 2026-04-17 12:45:59 +00:00
feat: add deployment automation scripts
This commit is contained in:
26
sync-and-restart.sh
Normal file
26
sync-and-restart.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure we are in the project directory
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Fetch the latest changes from the remote
|
||||
git remote update
|
||||
|
||||
# Check if local is behind remote (UPSTREAM)
|
||||
UPSTREAM=${1:-'@{u}'}
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse "$UPSTREAM")
|
||||
BASE=$(git merge-base @ "$UPSTREAM")
|
||||
|
||||
if [ $LOCAL = $REMOTE ]; then
|
||||
echo "Up-to-date"
|
||||
elif [ $LOCAL = $BASE ]; then
|
||||
echo "Need to pull"
|
||||
git pull
|
||||
# Only run deploy/restart if we actually pulled changes
|
||||
./deploy.sh
|
||||
elif [ $REMOTE = $BASE ]; then
|
||||
echo "Need to push"
|
||||
else
|
||||
echo "Diverged"
|
||||
fi
|
||||
Reference in New Issue
Block a user