From 8e376d57e10510c35adbd8c415d20f4d413326b4 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Sat, 10 Dec 2022 12:19:30 -0500 Subject: [PATCH] upgrade script fixes (finally ran it) --- scripts/apply_patches.sh | 5 ----- scripts/upgrade.sh | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/apply_patches.sh b/scripts/apply_patches.sh index 52eba93..79aa8db 100755 --- a/scripts/apply_patches.sh +++ b/scripts/apply_patches.sh @@ -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 diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 09c88af..7b58d1a 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -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..."