mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 22:16:15 +00:00
fix updater
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Updating Vito..."
|
||||
|
||||
cd /home/vito/vito
|
||||
@ -5,10 +7,30 @@ cd /home/vito/vito
|
||||
echo "Pulling changes..."
|
||||
git fetch --all
|
||||
|
||||
echo "Checking out the latest tag..."
|
||||
NEW_RELEASE=$(git tag -l "2.*" --sort=-v:refname | head -n 1)
|
||||
git checkout "$NEW_RELEASE"
|
||||
# Parse release type argument
|
||||
INCLUDE_PRE_RELEASES=""
|
||||
|
||||
if [[ "$1" == "--alpha" ]]; then
|
||||
INCLUDE_PRE_RELEASES="alpha|beta|rc"
|
||||
elif [[ "$1" == "--beta" ]]; then
|
||||
INCLUDE_PRE_RELEASES="beta|rc"
|
||||
fi
|
||||
|
||||
echo "Checking out the latest tag..."
|
||||
|
||||
if [[ -n "$INCLUDE_PRE_RELEASES" ]]; then
|
||||
NEW_RELEASE=$(git tag -l "3.*" | grep -E "$INCLUDE_PRE_RELEASES|^[0-9]+\.[0-9]+\.[0-9]+$" | sort -Vr | head -n 1)
|
||||
else
|
||||
NEW_RELEASE=$(git tag -l "3.*" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -Vr | head -n 1)
|
||||
fi
|
||||
|
||||
if [[ -z "$NEW_RELEASE" ]]; then
|
||||
echo "❌ No matching tag found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Switching to tag: $NEW_RELEASE"
|
||||
git checkout "$NEW_RELEASE"
|
||||
git pull origin "$NEW_RELEASE"
|
||||
|
||||
echo "Installing composer dependencies..."
|
||||
@ -30,4 +52,4 @@ sudo supervisorctl restart worker:*
|
||||
|
||||
bash scripts/post-update.sh
|
||||
|
||||
echo "Vito updated successfully to $NEW_RELEASE! 🎉"
|
||||
echo "✅ Vito updated successfully to $NEW_RELEASE! 🎉"
|
||||
|
Reference in New Issue
Block a user