Skip to content

Instantly share code, notes, and snippets.

@kramerc
Created December 10, 2023 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kramerc/f71d61ec84c1bf74e941b6d8df259302 to your computer and use it in GitHub Desktop.
Save kramerc/f71d61ec84c1bf74e941b6d8df259302 to your computer and use it in GitHub Desktop.
Mastodon upgrade scripts
#!/bin/sh
VERSION=$1
if [ -z $VERSION ]
then
echo "No version specified. Example: deploy_version.sh v4.1.3"
exit 1
fi
sudo systemctl stop mastodon-web mastodon-sidekiq mastodon-streaming && \
sudo -u mastodon rm -rvf /home/mastodon/live && \
sudo -u mastodon ln -s /home/mastodon/$VERSION /home/mastodon/live && \
sudo systemctl start mastodon-web mastodon-sidekiq mastodon-streaming
#!/bin/sh
VERSION=$1
if [ -z $VERSION ]
then
echo "No version specified. Example: fetch_version.sh v4.1.3"
exit 1
fi
cp -r /home/mastodon/live/ /home/mastodon/$VERSION
cd /home/mastodon/$VERSION
git fetch --all
git checkout $VERSION
bundle && yarn install --pure-lockfile && RAILS_ENV=production bundle exec rails assets:precompile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment