hs.scripts/rollback/taiga/update.sh

47 lines
1.2 KiB
Bash
Raw Normal View History

2024-04-25 13:49:12 +02:00
#!/bin/bash
# WIP
set -e
taiga_back="$HOME/taiga-back"
taiga_front="$HOME/taiga-front-dist"
read -p "DANGER Updating will also rollback this Taiga. Proceed? (Yy)" -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # https://stackoverflow.com/questions/1885525/how-do-i-prompt-a-user-for-confirmation-in-bash-script
fi
echo ">>> calling for rollback.sh"
. $HOME/scripts/rollback.sh
echo ">>> proceeding with the update"
cd $taiga_back
git pull
release=`git tag --sort=taggerdate | grep -E '[0-9]' | tail -1`
#current_release=`git describe --abbrev=0 --tags`
export DJANGO_SETTINGS_MODULE=settings.config
function pipupdate {
source .venv/bin/activate
pip install --upgrade pip wheel
pip install -r requirements.txt
}
function backupdate {
pipupdate
pip install git+https://github.com/kaleidos-ventures/taiga-contrib-protected.git@$release#egg=taiga-contrib-protected
python manage.py migrate --noinput
python manage.py compilemessages
python manage.py collectstatic --noinput
}
backupdate
cd $taiga_front
git pull
echo ">>> calling setstate.sh to make the update permanent"
. $HOME/scripts/setstate.sh
. $HOME/scripts/restart.sh