diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-12-20 16:03:28 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-12-20 16:03:28 +0000 |
commit | 1b6333fdefe9331ea4489248de51ce55552c732c (patch) | |
tree | 447e6081c90ddc24b0c29f28040bc72c724f8615 /_deploy/wsl/pre-run.sh | |
parent | 011e6777c9cf092bdcb8b5d9bfda8a0b86c69236 (diff) | |
download | troggle-1b6333fdefe9331ea4489248de51ce55552c732c.tar.gz troggle-1b6333fdefe9331ea4489248de51ce55552c732c.tar.bz2 troggle-1b6333fdefe9331ea4489248de51ce55552c732c.zip |
fixing setup scripts for a new Ubuntu 24.04 install
Diffstat (limited to '_deploy/wsl/pre-run.sh')
-rw-r--r-- | _deploy/wsl/pre-run.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/_deploy/wsl/pre-run.sh b/_deploy/wsl/pre-run.sh new file mode 100644 index 0000000..ab13800 --- /dev/null +++ b/_deploy/wsl/pre-run.sh @@ -0,0 +1,36 @@ +#! /bin/bash +# Do these before final testing, *not* just before pushing: +# Need to be in an ALREADY activated venv +PYTHON="python" + +echo "** Run inspectdb:" +$PYTHON manage.py inspectdb > troggle-inspectdb.py +# egrep -in "unable|error" troggle-inspectdb.py +echo "" +# count non-blank lines of python and template HTML code +# includes all variants of settings.py files + +# fix this as core/utils.py has 28,000 lines of numbers. +find . -name \*.html -print0 | xargs -0 egrep -vc "#|^\s*$" | grep -v ":0$" | grep -v ".venv" | awk -F ":" '{ sum +=$2; print $2, $1; } END {print sum}'| sort -n > lines-of-templates.txt + +find . -name \*.py -print0 | xargs -0 egrep -vc "#|^\s*$" | grep -v ":0$" | grep -v ".venv" | grep -v "/migrations/" |grep -v "troggle-inspectdb.py"| awk -F ":" '{ sum +=$2; print $2, $1; } END {print sum}'| sort -n > lines-of-python.txt + +echo "** Run reset-django.py - which deletes the database" +# This deletes the database so must run after generating troggle-inspectdb.py +$PYTHON reset-django.py +echo "** After cleanup deletion, remake all migrations." +$PYTHON manage.py makemigrations >/dev/null +$PYTHON manage.py migrate + +echo "** Now running self check" +$PYTHON manage.py check -v 3 --deploy 2>security-warnings.txt >/dev/null +$PYTHON manage.py check -v 3 --deploy + +echo "** Now running test suite" +# $PYTHON manage.py test -v 1 + +echo "" +echo `tail -1 lines-of-python.txt` non-comment lines of python. But core/utils.py has 28,000 lines of numbers. +echo `tail -1 lines-of-templates.txt` non-comment lines of HTML templates. + +echo '** If you have an error running manage.py, maybe you are not in an activated venv ?'
\ No newline at end of file |