summaryrefslogtreecommitdiffstats
path: root/_deploy/xubuntu/pre-push-barbie.sh
diff options
context:
space:
mode:
Diffstat (limited to '_deploy/xubuntu/pre-push-barbie.sh')
-rw-r--r--_deploy/xubuntu/pre-push-barbie.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/_deploy/xubuntu/pre-push-barbie.sh b/_deploy/xubuntu/pre-push-barbie.sh
new file mode 100644
index 0000000..5ea1aa0
--- /dev/null
+++ b/_deploy/xubuntu/pre-push-barbie.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+# create and sanitise files for pushing to repo, for Babie laptop
+
+echo deprecations.
+python -Wall manage.py check -v 3 2>deprecations.txt >/dev/null
+echo diffsettings.
+rm diffsettings.txt
+if test -f "diffsettings.txt"; then
+ echo "diffsettings.txt not deleted. You have a serious permissions problem. Aborting.."
+ exit
+fi
+python manage.py diffsettings | grep "###" > diffsettings.txt
+echo pip freeze.
+pip freeze > requirements.txt
+echo inspectdb.
+# this next line requires database setting to be troggle.sqlite:
+python manage.py inspectdb > troggle-inspectdb.py
+#egrep -in "unable|error" troggle-inspectdb.py
+echo remove passwords.
+cp localsettings.py localsettingsXubuntu.py
+sed -i '/EXPOUSERPASS/ s/^.*$/EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"/' diffsettings.txt
+sed -i '/EXPOUSERPASS/ s/^.*$/EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"/' localsettingsXubuntu.py
+echo " reset: EXPOUSERPASS = \"nnn:gggggg\" - real-expo-password---imported-from-localsettings.py"
+
+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"/' localsettingsXubuntu.py
+echo " reset: EXPOUSERPASS = \"gggggg:nnn\" - real-expo-password---imported-from-localsettings.py"
+
+sed -i '/EMAIL_HOST_PASSWORD/ s/^.*$/EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"/' diffsettings.txt
+sed -i '/EMAIL_HOST_PASSWORD/ s/^.*$/EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"/' localsettingsXubuntu.py
+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
+sed -i '/SECRET_KEY/ s/^.*$/SECRET_KEY = "real-SECRET_KEY--imported-from-localsettings.py"/' localsettingsXubuntu.py
+echo " reset: SECRET_KEY = \"real-SECRET_KEY--imported-from-localsettings.py\""
+
+mv _deploy/xubuntu/localsettingsXubuntu.py _deploy/xubuntu/localsettingsXubuntu.py.bak
+mv localsettingsXubuntu.py _deploy/xubuntu
+#
+# Do these before final testing, *not* just before pushing:
+# in ./pre-run.sh
+# 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