Browse Source

ensure_web_installed

pull/11/head
Pavel "LEdoian" Turinsky 2 years ago
parent
commit
d468108188
  1. 7
      make/lib.sh
  2. 2
      make/run
  3. 2
      make/schema
  4. 2
      make/sync_prod_flatpages
  5. 2
      make/test

7
make/lib.sh

@ -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

2
make/run

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

2
make/schema

@ -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

2
make/sync_prod_flatpages

@ -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" "

2
make/test

@ -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

Loading…
Cancel
Save