Update tandoor.sh

fix update function
This commit is contained in:
tteckster 2024-03-12 12:47:31 -04:00 committed by GitHub
parent ee82bc777d
commit e15d82fb7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,26 +54,25 @@ function default_settings() {
} }
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/tandoor ]]; then if [[ ! -d /opt/tandoor ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_error "No ${APP} Installation Found!"; if cd /opt/tandoor && git pull | grep -q 'Already up to date'; then
exit; msg_ok "There is currently no update available."
fi else
msg_info "Updating ${APP} LXC" msg_info "Updating ${APP} (Patience)"
if cd /opt/tandoor && git pull | grep -q 'Already up to date'; then
msg_error "There is currently no update path available."
else
export $(cat /opt/tandoor/.env | grep "^[^#]" | xargs) export $(cat /opt/tandoor/.env | grep "^[^#]" | xargs)
/opt/tandoor/bin/pip3 install -r requirements.txt >/dev/null 2>&1 cd /opt/tandoor/
/opt/tandoor/bin/python3 manage.py migrate >/dev/null 2>&1 pip3 install -r requirements.txt >/dev/null 2>&1
/opt/tandoor/bin/python3 manage.py collectstatic --no-input >/dev/null 2>&1 /usr/bin/python3 /opt/tandoor/manage.py migrate >/dev/null 2>&1
/opt/tandoor/bin/python3 manage.py collectstatic_js_reverse >/dev/null 2>&1 /usr/bin/python3 /opt/tandoor/manage.py collectstatic --no-input >/dev/null 2>&1
/usr/bin/python3 /opt/tandoor/manage.py collectstatic_js_reverse >/dev/null 2>&1
cd /opt/tandoor/vue cd /opt/tandoor/vue
yarn install >/dev/null 2>&1 yarn install >/dev/null 2>&1
yarn build >/dev/null 2>&1 yarn build >/dev/null 2>&1
sudo systemctl restart gunicorn_tandoor systemctl restart gunicorn_tandoor
fi msg_ok "Updated ${APP}"
exit fi
exit
} }
start start