mastodon/UPDATE.md

1.7 KiB

I can never seem to remember how to update each time, so I'm taking notes.

This is just a copy of how I did it last time, which probably isn't best but complex git stuff is above my pay grade

First, check any changes on the live environment.

  • git status
    • git commit -v -a && git push (if needed)

Now update the upstream dir and make a branch, because git won't merge from a tag

  • cd ~/projects/mastodon/mastodon-upstream

  • git pull

  • git tag | tail ## look for the latest release tag

  • git checkout v4.XX ## use that tag

  • git branch 4XX

  • git checkout 4XX ## from here you can check the log to be sure

  • git checkout main ## gets us out of the detached head state

Merge from the server into deploy

  • cd ../mastodon-deploy
  • git pull # grab any updates from the first step
  • git remote add localupstream ../mastodon-deploy ## only if we started fresh otherwise it's still here
  • git fetch localupstream
  • git merge localupstream/4XX ## branch name from previous step
  • git push

Now it's time to update the live server

  • (be root)
  • cd /srv/mastodon
  • DOUBLE CHECK THE DOCKER COMPOSE FILE! Upstream might have given a public image name and we don't want that
  • git pull
  • CHECK THE DISK SPACE!!! need plenty of disk free (20%?) on / otherwise it will fall on its face

    • low hanging disk fruit: go around doing docker compose up -d --force-recreate in various non-mastodon places to purge some logs and other shit
      • /srv/nginx
      • /srv/synapse
  • DOUBLE CHECK THE RELEASE INSTRUCTIONS FOR SPECIAL STEPS

  • docker compose up -d

Once satisfied, do some cleanup

  • docker system prune