mirror of
https://github.com/jakejarvis/mastodon-utils.git
synced 2025-04-26 03:25:22 -04:00
upgrade script fixes (finally ran it)
This commit is contained in:
parent
0684a65b65
commit
8e376d57e1
@ -19,11 +19,6 @@ then
|
|||||||
sudo git config --global --add safe.directory "$SCRIPTS_ROOT"
|
sudo git config --global --add safe.directory "$SCRIPTS_ROOT"
|
||||||
fi
|
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
|
# apply custom patches
|
||||||
cd "$APP_ROOT"
|
cd "$APP_ROOT"
|
||||||
sudo -u mastodon git apply --allow-binary-replacement "$SCRIPTS_ROOT"/patches/*.patch
|
sudo -u mastodon git apply --allow-binary-replacement "$SCRIPTS_ROOT"/patches/*.patch
|
||||||
|
@ -6,6 +6,7 @@ set -euo pipefail
|
|||||||
# default paths
|
# default paths
|
||||||
MASTODON_ROOT=/home/mastodon
|
MASTODON_ROOT=/home/mastodon
|
||||||
APP_ROOT="$MASTODON_ROOT/live"
|
APP_ROOT="$MASTODON_ROOT/live"
|
||||||
|
SCRIPTS_ROOT="$MASTODON_ROOT/scripts"
|
||||||
RBENV_ROOT="$MASTODON_ROOT/.rbenv"
|
RBENV_ROOT="$MASTODON_ROOT/.rbenv"
|
||||||
|
|
||||||
# check for existing installation
|
# check for existing installation
|
||||||
@ -17,6 +18,7 @@ fi
|
|||||||
# pull latest mastodon source
|
# pull latest mastodon source
|
||||||
cd "$APP_ROOT"
|
cd "$APP_ROOT"
|
||||||
sudo -u mastodon git fetch --all
|
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
|
if [ -d "$APP_ROOT/app/javascript/flavours/glitch" ]; then
|
||||||
# glitch-soc (uses latest commits)
|
# glitch-soc (uses latest commits)
|
||||||
echo "Pulling latest glitch-soc commits..."
|
echo "Pulling latest glitch-soc commits..."
|
||||||
@ -28,7 +30,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# pull & apply latest patches
|
# pull & apply latest patches
|
||||||
. "$(dirname "$0")/apply_patches.sh"
|
. "$SCRIPTS_ROOT/scripts/apply_patches.sh"
|
||||||
|
|
||||||
# set new ruby version
|
# set new ruby version
|
||||||
RUBY_VERSION="$(sudo -u mastodon cat $APP_ROOT/.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
|
# restart mastodon
|
||||||
echo "Restarting services (round 1/2)..."
|
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
|
# clear caches & run post-deployment db migration
|
||||||
echo "Clearing cache..."
|
echo "Clearing cache..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user