rattail-fabric/rattail_fabric/deploy/backup/backup-everything.mako
Lance Edgar d519db62bd Tweak backup-everything script just a bit more
check git status of rattail src prior to upgrading that, etc.
2018-07-05 15:06:34 -05:00

36 lines
845 B
Mako
Executable file

#!/bin/sh -e
if [ "$1" = "-v" -o "$1" = "--verbose" ]; then
VERBOSE='--verbose'
QUIET=
PROGRESS='--progress'
CONFIG='/srv/envs/${envname}/app/rattail.conf'
else
VERBOSE=
QUIET='--quiet'
PROGRESS=
CONFIG='/srv/envs/${envname}/app/silent.conf'
fi
RATTAIL="/srv/envs/${envname}/bin/rattail --config=$CONFIG $PROGRESS"
PIP=/srv/envs/${envname}/bin/pip
export PIP_CONFIG_FILE=/srv/envs/${envname}/pip.conf
# upgrade pip
$PIP install $QUIET --upgrade pip
# upgrade rattail
cd /srv/envs/${envname}/src/rattail
if [ "$(sudo -u ${user} git status --porcelain)" != '' ]; then
sudo -u ${user} git status
exit 1
fi
sudo -u ${user} git pull $QUIET
sudo -u ${user} find . -name '*.pyc' -delete
$PIP install $QUIET --upgrade --upgrade-strategy eager --editable .
# run backup
cd /srv/envs/${envname}
$RATTAIL backup