aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-02-10 10:41:57 +0300
committerFrederick Muriuki Muriithi2023-02-10 11:13:30 +0300
commit0d7dceede0ae557403d84c56105235d938eae8ae (patch)
tree9ad7a88829bd9df770b9ff54d8a2626eeedd1c3a
parent89f6b81a4d44448ca4f7b29bc6c09fd6205e11f4 (diff)
downloadgenenetwork3-0d7dceede0ae557403d84c56105235d938eae8ae.tar.gz
Add example utility script to run development server
-rw-r--r--.gitignore8
-rw-r--r--example-run-dev.sh31
2 files changed, 37 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index eff1d77..176cfba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -180,8 +180,12 @@ dmypy.json
# Pyre type checker
.pyre/
-# emacs temporary files
+# temporary files and directories
/**/*~
+/tmp
# yoyo configs
-/**/yoyo*.ini \ No newline at end of file
+/**/yoyo*.ini
+
+# utility scripts
+/run-dev.sh \ No newline at end of file
diff --git a/example-run-dev.sh b/example-run-dev.sh
new file mode 100644
index 0000000..a0c5d61
--- /dev/null
+++ b/example-run-dev.sh
@@ -0,0 +1,31 @@
+
+## An example script to run the development server.
+## Copy to run-dev.sh and update the appropriate environment variables.
+
+export SQL_URI="${SQL_URI:+${SQL_URI}}"
+export AUTH_DB="${AUTH_DB:+${AUTH_DB}}"
+export FLASK_DEBUG=1
+export FLASK_APP="main.py"
+export AUTHLIB_INSECURE_TRANSPORT=true
+
+CMD_ARGS=$@
+if [ ${#CMD_ARGS} -eq 0 ]
+then
+ CMD_ARGS=("run" "--port=8080")
+fi
+
+if [ -z "${SQL_URI}" ]
+then
+ echo "ERROR: You need to specify the 'SQL_URI' environment variable";
+ exit 1;
+fi
+
+if [ -z "${AUTH_DB}" ]
+then
+ echo "ERROR: You need to specify the 'AUTH_DB' environment variable";
+ exit 1;
+fi
+
+
+# flask run --port=8080
+flask ${CMD_ARGS[@]}