Skip to content

Instantly share code, notes, and snippets.

@gc373
Created June 22, 2017 12:11
Show Gist options
  • Select an option

  • Save gc373/933e9ae43ed3bbf716c2ddb4509517b0 to your computer and use it in GitHub Desktop.

Select an option

Save gc373/933e9ae43ed3bbf716c2ddb4509517b0 to your computer and use it in GitHub Desktop.
mstdn1.4.3 to 1.4.4
#!/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/masterdon
echo "-----Stashing changes, fetching and pulling latest tag-----"
git stash
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
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 up -d
docker system prune -f
echo "-----Unattended upgrade finished-----"
rm /var/tmp/maintenance
echo "----- Done !!!!! -----"
@gc373
Copy link
Author

gc373 commented Jun 22, 2017

this shellscript from
Create a script for easy updates on docker-compose #2396

these 2 lines L14 L32 is for nginx settings.
like this.

if (-e /var/tmp/maintenance)  {
      return 503;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment