From 5f441490bec882cec63529efe99ff1a2e659849f Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <yohann.danello@gmail.com>
Date: Wed, 11 Mar 2020 16:39:27 +0100
Subject: [PATCH] Update Docker entrypoint to use environment in initial
 fixtures

---
 entrypoint.sh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/entrypoint.sh b/entrypoint.sh
index f05e962a..97efb023 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -2,12 +2,17 @@
 # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
 # SPDX-License-Identifier: GPL-3.0-or-later
 
+if [ -z ${NOTE_URL+x} ]; then
+  echo "Warning: your env files are not configurated."
+else
+  sed -i -e "s/example.com/$MAILING_LIST_DOMAIN/g" /code/apps/member/fixtures/initial.json
+  sed -i -e "s/localhost/$NOTE_URL/g" /code/note_kfet/fixtures/initial.json
+  sed -i -e "s/\.\*/https?:\/\/$NOTE_URL\/.*/g" /code/note_kfet/fixtures/cas.json
+  sed -i -e "s/REPLACEME/La Note Kfet \\\\ud83c\\\\udf7b/g" /code/note_kfet/fixtures/cas.json
+fi
+
 python manage.py compilemessages
 python manage.py makemigrations
-
-# Wait for database
-sleep 5
 python manage.py migrate
 
-# TODO: use uwsgi in production
 python manage.py runserver 0.0.0.0:8000
-- 
GitLab