ensure_web_installed

This commit is contained in:
Pavel "LEdoian" Turinsky 2022-11-21 21:59:38 +01:00
parent 6b306f0849
commit d468108188
5 changed files with 11 additions and 4 deletions

View file

@ -33,6 +33,13 @@ function ensure_venv {
python -c 'print()' > /dev/null || die "Python ve venvu je rozbitý. Prosím smaž venv a zkus to znovu."
}
function ensure_web_installed {
ensure_venv
python -c 'import django; print(django.__version__)' > /dev/null && return
echo >&2 "POZOR: Web nevypadá nainstalovaně, instaluji."
make/install_web
}
function gimli_only {
# Rovnou zkontrolujeme i uživatele
if test "$HOSTNAME" != gimli -o "$USER" != mam-web

View file

@ -3,6 +3,6 @@
set -exuo pipefail
. make/lib.sh
ensure_venv
ensure_web_installed
./manage.py runserver "$@"

View file

@ -3,7 +3,7 @@
set -exuo pipefail
. make/lib.sh
ensure_venv
ensure_web_installed
./manage.py graph_models seminar | dot -Tpdf > schema_seminar.pdf
./manage.py graph_models -a -g | dot -Tpdf > schema_all.pdf

View file

@ -3,7 +3,7 @@
set -exuo pipefail
. make/lib.sh
ensure_venv
ensure_web_installed
# TODO: This is very ugly, will fix in a future PR (hopefully)
ssh "$GIMLI_LOGIN" "

View file

@ -3,7 +3,7 @@
set -exuo pipefail
. make/lib.sh
ensure_venv
ensure_web_installed
trap - ERR # Testy nejspíš selžou, ale nechceme kolem toho dělat další chybovou hlášku.
./manage.py test -v2