overlay/www-apps/pleroma-installer/files/upgrade_pleroma-r1.sh
tastytea 14baf1f984
www-apps/pleroma-installer: Version bump: 5
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Manifest-Sign-Key: 3555266864CA6D7FF45AA6E7CFC39497F1B26E07
2019-02-23 07:33:15 +01:00

35 lines
839 B
Bash

#!/bin/sh
echo "This script will upgrade your pleroma installation."
echo "Pleroma will be stopped for the duration of the update."
echo "Hit enter to proceed."
read sure
if [ -n "${sure}" ]; then
exit
fi
purple='\033[1;35m'
nocolor='\033[0m'
function die()
{
if [ -n "${1}" ]; then
echo "${1}" >&2
fi
exit 1
}
echo -e "${purple}Stopping pleroma...${nocolor}"
sudo /etc/init.d/pleroma stop || die
echo -e "${purple}Pulling the latest changes from upstream...${nocolor}"
sudo -u pleroma git pull || die
echo -e "${purple}Upgrading dependencies...${nocolor}"
sudo -u pleroma mix deps.get || die
echo -e "${purple}Performing database migrations...${nocolor}"
sudo -u pleroma MIX_ENV=prod mix ecto.migrate || die
echo -e "\n${purple}Done! Restarting pleroma...${nocolor}"
sudo /etc/init.d/pleroma restart || die