2020-06-20 15:43:28 +01:00
|
|
|
#! /bin/sh
|
|
|
|
# create and sanitise files for pushing to repo
|
2021-10-23 19:07:16 +01:00
|
|
|
# catatrophically forgot to sanitize localsettingsWSL.py - oops.
|
2022-04-12 20:42:36 +01:00
|
|
|
|
|
|
|
#Make sure you have the WSL permissions system working, or you will push unsanitized files as this will fail
|
|
|
|
# Philip Sargent 2022/04/12
|
2020-06-20 15:43:28 +01:00
|
|
|
echo deprecations.
|
|
|
|
python -Wall manage.py check -v 3 2>deprecations.txt >/dev/null
|
|
|
|
echo diffsettings.
|
2022-04-12 20:42:36 +01:00
|
|
|
rm diffsettings.txt
|
|
|
|
if test -f "diffsettings.txt"; then
|
|
|
|
echo "diffsettings.txt not deleted. You have a serious permissions problem. Aborting.."
|
|
|
|
exit
|
|
|
|
fi
|
2020-06-20 15:43:28 +01:00
|
|
|
python manage.py diffsettings | grep "###" > diffsettings.txt
|
|
|
|
echo pip freeze.
|
|
|
|
pip freeze > requirements.txt
|
|
|
|
echo inspectdb.
|
2020-06-20 17:19:50 +01:00
|
|
|
# this next line requires database setting to be troggle.sqlite:
|
2020-06-20 15:43:28 +01:00
|
|
|
python manage.py inspectdb > troggle-inspectdb.py
|
|
|
|
#egrep -in "unable|error" troggle-inspectdb.py
|
|
|
|
echo remove passwords.
|
|
|
|
cp localsettings.py localsettingsWSL.py
|
2021-04-06 00:49:09 +01:00
|
|
|
sed -i '/EXPOUSERPASS/ s/^.*$/EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"/' diffsettings.txt
|
2021-10-23 19:07:16 +01:00
|
|
|
sed -i '/EXPOUSERPASS/ s/^.*$/EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"/' localsettingsWSL.py
|
2021-04-06 00:49:09 +01:00
|
|
|
echo " reset: EXPOUSERPASS = \"nnn:gggggg\" - real-expo-password---imported-from-localsettings.py"
|
2021-04-02 19:22:53 +01:00
|
|
|
|
2021-10-23 19:07:16 +01:00
|
|
|
sed -i '/EXPOADMINUSERPASS/ s/^.*$/EXPOADMINUSERPASS = "gggggg:nnn - real-expo-password---imported-from-localsettings.py"/' diffsettings.txt
|
|
|
|
sed -i '/EXPOADMINUSERPASS/ s/^.*$/EXPOADMINUSERPASS = "gggggg:nnn - real-expo-password---imported-from-localsettings.py"/' localsettingsWSL.py
|
2021-04-06 00:49:09 +01:00
|
|
|
echo " reset: EXPOUSERPASS = \"gggggg:nnn\" - real-expo-password---imported-from-localsettings.py"
|
2021-04-02 19:22:53 +01:00
|
|
|
|
2021-04-06 00:49:09 +01:00
|
|
|
sed -i '/EMAIL_HOST_PASSWORD/ s/^.*$/EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"/' diffsettings.txt
|
2021-10-23 19:07:16 +01:00
|
|
|
sed -i '/EMAIL_HOST_PASSWORD/ s/^.*$/EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"/' localsettingsWSL.py
|
2021-04-06 00:49:09 +01:00
|
|
|
echo " reset: EMAIL_HOST_PASSWORD = \"real-email-password--imported-from-localsettings.py\""
|
|
|
|
|
|
|
|
sed -i '/SECRET_KEY/ s/^.*$/SECRET_KEY = "real-SECRET_KEY--imported-from-localsettings.py"/' diffsettings.txt
|
2021-10-23 19:07:16 +01:00
|
|
|
sed -i '/SECRET_KEY/ s/^.*$/SECRET_KEY = "real-SECRET_KEY--imported-from-localsettings.py"/' localsettingsWSL.py
|
2021-04-06 00:49:09 +01:00
|
|
|
echo " reset: SECRET_KEY = \"real-SECRET_KEY--imported-from-localsettings.py\""
|
2021-04-02 19:22:53 +01:00
|
|
|
|
2022-04-12 20:42:36 +01:00
|
|
|
mv _deploy/wsl/localsettingsWSL.py _deploy/wsl/localsettingsWSL.py.bak
|
2021-10-23 19:07:16 +01:00
|
|
|
mv localsettingsWSL.py _deploy/wsl
|
2020-06-20 15:43:28 +01:00
|
|
|
#
|
|
|
|
# Do these before final testing, *not* just before pushing:
|
2020-06-24 01:57:20 +01:00
|
|
|
# in ./pre-run.sh
|
2020-06-20 15:43:28 +01:00
|
|
|
# python reset-django.py
|
|
|
|
# python manage.py makemigrations
|
|
|
|
# python manage.py test
|
|
|
|
# python manage.py inspectdb > troggle-inspectdb.py
|
|
|
|
# egrep -i "unable|error" troggle-inspectdb.py
|