Cleanup secrets management, pre-run checks.

This commit is contained in:
Philip Sargent
2020-06-20 15:43:28 +01:00
parent b35a0b0d26
commit e697466557
25 changed files with 334 additions and 1018 deletions

17
pre-run.sh Normal file
View File

@@ -0,0 +1,17 @@
#! /bin/sh
# Do these before final testing, *not* just before pushing:
# Philip Sargent 2020/06/20
python reset-django.py
echo After cleanup deletion, remake all migrations.
python manage.py makemigrations >/dev/null
python manage.py test
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
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
find . -name \*.py -print0 | xargs -0 egrep -vc "#|^\s*$" | grep -v "0$" | awk -F ":" '{ sum +=$2; print $2, $1; } END {print sum}'| sort -n > lines-of-python.txt
echo `tail -1 lines-of-python.txt` non-comment lines of python.