2018-07-05 12:40:36 -05:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
if [ "$1" = "-v" -o "$1" = "--verbose" ]; then
|
|
|
|
VERBOSE='--verbose'
|
2018-07-05 13:19:20 -05:00
|
|
|
QUIET=
|
2018-07-05 12:40:36 -05:00
|
|
|
PROGRESS='--progress'
|
2018-07-05 15:06:34 -05:00
|
|
|
CONFIG='/srv/envs/${envname}/app/rattail.conf'
|
2018-07-05 12:40:36 -05:00
|
|
|
else
|
|
|
|
VERBOSE=
|
2018-07-05 13:19:20 -05:00
|
|
|
QUIET='--quiet'
|
2018-07-05 12:40:36 -05:00
|
|
|
PROGRESS=
|
2018-07-05 15:06:34 -05:00
|
|
|
CONFIG='/srv/envs/${envname}/app/silent.conf'
|
2018-07-05 12:40:36 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2018-07-09 21:24:30 -05:00
|
|
|
RATTAIL="/srv/envs/${envname}/bin/rattail --config=$CONFIG $PROGRESS $VERBOSE"
|
2018-07-05 21:47:58 -05:00
|
|
|
PIP="sudo -u ${user} PIP_CONFIG_FILE=/srv/envs/${envname}/pip.conf /srv/envs/${envname}/bin/pip"
|
2018-07-05 13:19:20 -05:00
|
|
|
|
2018-07-05 15:06:34 -05:00
|
|
|
# upgrade pip
|
|
|
|
$PIP install $QUIET --upgrade pip
|
2018-07-05 13:19:20 -05:00
|
|
|
|
2018-07-05 15:06:34 -05:00
|
|
|
# upgrade rattail
|
|
|
|
cd /srv/envs/${envname}/src/rattail
|
|
|
|
if [ "$(sudo -u ${user} git status --porcelain)" != '' ]; then
|
|
|
|
sudo -u ${user} git status
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-07-05 13:19:20 -05:00
|
|
|
sudo -u ${user} git pull $QUIET
|
|
|
|
sudo -u ${user} find . -name '*.pyc' -delete
|
2018-07-05 15:06:34 -05:00
|
|
|
$PIP install $QUIET --upgrade --upgrade-strategy eager --editable .
|
2018-07-05 12:40:36 -05:00
|
|
|
|
2018-07-05 15:06:34 -05:00
|
|
|
# run backup
|
|
|
|
cd /srv/envs/${envname}
|
2018-07-05 12:40:36 -05:00
|
|
|
$RATTAIL backup
|