Tweak backup-everything script just a bit more
check git status of rattail src prior to upgrading that, etc.
This commit is contained in:
parent
2fcb81e0ae
commit
d519db62bd
|
@ -76,6 +76,7 @@ def deploy_backup_app(deploy, envname, mkvirtualenv=True, user='rattail',
|
||||||
sudo('git clone https://rattailproject.org/git/rattail.git src/rattail', user=user)
|
sudo('git clone https://rattailproject.org/git/rattail.git src/rattail', user=user)
|
||||||
with cd('src/rattail'):
|
with cd('src/rattail'):
|
||||||
sudo('git pull', user=user)
|
sudo('git pull', user=user)
|
||||||
|
deploy_generic('backup/git-exclude', '.git/info/exclude', owner=user)
|
||||||
sudo('bin/pip install --upgrade --upgrade-strategy eager --editable src/rattail', user=user)
|
sudo('bin/pip install --upgrade --upgrade-strategy eager --editable src/rattail', user=user)
|
||||||
|
|
||||||
# TODO: this should not be necessary
|
# TODO: this should not be necessary
|
||||||
|
|
|
@ -4,27 +4,32 @@ if [ "$1" = "-v" -o "$1" = "--verbose" ]; then
|
||||||
VERBOSE='--verbose'
|
VERBOSE='--verbose'
|
||||||
QUIET=
|
QUIET=
|
||||||
PROGRESS='--progress'
|
PROGRESS='--progress'
|
||||||
CONFIG='app/rattail.conf'
|
CONFIG='/srv/envs/${envname}/app/rattail.conf'
|
||||||
else
|
else
|
||||||
VERBOSE=
|
VERBOSE=
|
||||||
QUIET='--quiet'
|
QUIET='--quiet'
|
||||||
PROGRESS=
|
PROGRESS=
|
||||||
CONFIG='app/silent.conf'
|
CONFIG='/srv/envs/${envname}/app/silent.conf'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
cd /srv/envs/${envname}
|
RATTAIL="/srv/envs/${envname}/bin/rattail --config=$CONFIG $PROGRESS"
|
||||||
|
PIP=/srv/envs/${envname}/bin/pip
|
||||||
|
export PIP_CONFIG_FILE=/srv/envs/${envname}/pip.conf
|
||||||
|
|
||||||
RATTAIL="bin/rattail --config=$CONFIG $PROGRESS"
|
# upgrade pip
|
||||||
PIP='bin/pip'
|
$PIP install $QUIET --upgrade pip
|
||||||
export PIP_CONFIG_FILE=pip.conf
|
|
||||||
|
|
||||||
$PIP install --upgrade pip
|
# upgrade rattail
|
||||||
|
cd /srv/envs/${envname}/src/rattail
|
||||||
cd 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} git pull $QUIET
|
||||||
sudo -u ${user} find . -name '*.pyc' -delete
|
sudo -u ${user} find . -name '*.pyc' -delete
|
||||||
cd -
|
$PIP install $QUIET --upgrade --upgrade-strategy eager --editable .
|
||||||
$PIP install --upgrade --upgrade-strategy eager --editable src/rattail
|
|
||||||
|
|
||||||
|
# run backup
|
||||||
|
cd /srv/envs/${envname}
|
||||||
$RATTAIL backup
|
$RATTAIL backup
|
||||||
|
|
1
rattail_fabric/deploy/backup/git-exclude
Normal file
1
rattail_fabric/deploy/backup/git-exclude
Normal file
|
@ -0,0 +1 @@
|
||||||
|
**/__pycache__/
|
Loading…
Reference in a new issue