1
mirror of https://github.com/jakejarvis/mastodon-utils.git synced 2025-04-25 22:45:22 -04:00

upgrade script fixes (finally ran it)

This commit is contained in:
Jake Jarvis 2022-12-10 12:19:30 -05:00
parent 0684a65b65
commit 8e376d57e1
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
2 changed files with 4 additions and 7 deletions

View File

@ -19,11 +19,6 @@ then
sudo git config --global --add safe.directory "$SCRIPTS_ROOT"
fi
# pull latest patches
cd "$SCRIPTS_ROOT"
sudo -u mastodon git fetch origin --all
sudo -u mastodon git reset origin/main --hard
# apply custom patches
cd "$APP_ROOT"
sudo -u mastodon git apply --allow-binary-replacement "$SCRIPTS_ROOT"/patches/*.patch

View File

@ -6,6 +6,7 @@ set -euo pipefail
# default paths
MASTODON_ROOT=/home/mastodon
APP_ROOT="$MASTODON_ROOT/live"
SCRIPTS_ROOT="$MASTODON_ROOT/scripts"
RBENV_ROOT="$MASTODON_ROOT/.rbenv"
# check for existing installation
@ -17,6 +18,7 @@ fi
# pull latest mastodon source
cd "$APP_ROOT"
sudo -u mastodon git fetch --all
sudo -u mastodon git stash push --message "pre-upgrade changes"
if [ -d "$APP_ROOT/app/javascript/flavours/glitch" ]; then
# glitch-soc (uses latest commits)
echo "Pulling latest glitch-soc commits..."
@ -28,7 +30,7 @@ else
fi
# pull & apply latest patches
. "$(dirname "$0")/apply_patches.sh"
. "$SCRIPTS_ROOT/scripts/apply_patches.sh"
# set new ruby version
RUBY_VERSION="$(sudo -u mastodon cat $APP_ROOT/.ruby-version)"
@ -42,7 +44,7 @@ sudo -u mastodon SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production "$RBE
# restart mastodon
echo "Restarting services (round 1/2)..."
sudo systemctl restart mastodon-sidekiq mastodon-streaming
sudo systemctl restart mastodon-web mastodon-sidekiq mastodon-streaming
# clear caches & run post-deployment db migration
echo "Clearing cache..."