Last active
June 18, 2017 01:59
-
-
Save gc373/f2c14a6fab242805a82605da97c440a1 to your computer and use it in GitHub Desktop.
Now , update my Mastodon instance 1.4.1 to 1.4.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ##################################################### | |
| # This script is intended for unattended upgrades | |
| # of a standard Mastodon installation. | |
| # Uncommited changes i.e. in config files | |
| # will be stashed and restored. | |
| # This script is not intended for forks with commits | |
| # as the latest release will be checked out. | |
| # Database migrations and asset-precompilation will | |
| # run automatically. | |
| # Contributed my @Halest | |
| ##################################################### | |
| echo "-----Server down to 503-----" | |
| touch /var/tmp/maintenance | |
| cd /home/mastodon | |
| echo "-----Stashing changes, fetching and pulling latest tag-----" | |
| git stash | |
| git fetch --tags | |
| git checkout v1.4.3 | |
| git stash pop | |
| echo "-----Recreating images and containers-----" | |
| service docker restart | |
| docker-compose stop | |
| docker-compose rm -f | |
| docker-compose build | |
| echo "-----Running migrations and precompilations-----" | |
| docker-compose run --rm web rails assets:precompile | |
| docker-compose run --rm web rails mastodon:maintenance:prepare_for_foreign_keys | |
| docker-compose run --rm web rails db:migrate | |
| docker-compose up -d | |
| docker system prune -f | |
| echo "-----Unattended upgrade finished-----" | |
| rm /var/tmp/maintenance | |
| echo "----- Done !!!!! -----" |
Author
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this shellscript from
Create a script for easy updates on docker-compose #2396