From 2c4a6a8cea82e0e78d9c126842f7a35373863052 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Thu, 17 Oct 2019 11:16:08 +0200
Subject: [PATCH] Generalize docker-entrypoint for further flask commands
---
docker-entrypoint.sh | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index ec28a3c0..f60f3f48 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -1,19 +1,12 @@
#!/bin/sh
-if [[ $# -eq 0 ]]
+if [ $# -eq 0 ]
then
- venv/bin/python -u opaque.py
-elif [[ $1 == "--migrate" ]]
- then
- echo Migrating changes.
- venv/bin/python -m flask db migrate
- venv/bin/python -m flask db upgrade
+ venv/bin/python -u opaque.py
+elif [ $1 == "flask" ]
+then
+ echo "$@"
+ venv/bin/python -m $@
else
- if [[ $1 == "--setup-database" ]]
- then
- echo Initial setup of database.
- venv/bin/python -m flask db init
- venv/bin/python -m flask db upgrade
- venv/bin/python -m flask insert-initial-database-entries
- fi
+ echo "Unknown command"
fi