2020-06-20 15:43:28 +01:00
|
|
|
#! /bin/sh
|
|
|
|
# Do these before final testing, *not* just before pushing:
|
|
|
|
# Philip Sargent 2020/06/20
|
|
|
|
echo Run inspectdb:
|
2020-07-20 23:51:15 +01:00
|
|
|
python3 manage.py inspectdb > troggle-inspectdb.py
|
2020-06-20 15:43:28 +01:00
|
|
|
# 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
|
2020-06-20 19:55:23 +01:00
|
|
|
find . -name \*.html -print0 | xargs -0 egrep -vc "#|^\s*$" | grep -v ":0$" | awk -F ":" '{ sum +=$2; print $2, $1; } END {print sum}'| sort -n > lines-of-templates.txt
|
2020-06-20 15:43:28 +01:00
|
|
|
|
2020-06-20 19:55:23 +01:00
|
|
|
find . -name \*.py -print0 | xargs -0 egrep -vc "#|^\s*$" | grep -v ":0$" | grep -v "/migrations/" |grep -v "troggle-inspectdb.py"| awk -F ":" '{ sum +=$2; print $2, $1; } END {print sum}'| sort -n > lines-of-python.txt
|
2020-06-20 23:08:34 +01:00
|
|
|
|
2020-06-20 17:19:50 +01:00
|
|
|
|
|
|
|
# This deletes the database so must run after generating troggle-inspectdb.py
|
2020-07-20 23:51:15 +01:00
|
|
|
python3 reset-django.py
|
2020-06-20 17:19:50 +01:00
|
|
|
echo After cleanup deletion, remake all migrations.
|
2020-07-20 23:51:15 +01:00
|
|
|
python3 manage.py makemigrations >/dev/null
|
2021-05-13 21:15:30 +01:00
|
|
|
python3 manage.py migrate
|
2020-07-20 23:51:15 +01:00
|
|
|
python3 manage.py test
|
|
|
|
python3 manage.py check -v 3 --deploy 2>security-warnings.txt >/dev/null
|
|
|
|
python3 manage.py check -v 3 --deploy
|
2020-06-20 23:08:34 +01:00
|
|
|
echo ""
|
2020-07-20 23:51:15 +01:00
|
|
|
echo `tail -1 lines-of-python.txt` non-comment lines of python.
|
2021-03-24 20:38:43 +00:00
|
|
|
echo `tail -1 lines-of-templates.txt` non-comment lines of HTML templates.
|