changeset 4201:6a8cc6d668a4

docker (demo): create file-sharing and demo account in init script
author Goffi <goffi@goffi.org>
date Thu, 14 Dec 2023 09:19:32 +0100
parents 5d2de6c1156d
children b26339343076
files docker/backend-dev-demo/Dockerfile docker/backend-dev-demo/scripts/init_script.sh
diffstat 2 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/docker/backend-dev-demo/Dockerfile	Wed Dec 13 22:00:25 2023 +0100
+++ b/docker/backend-dev-demo/Dockerfile	Thu Dec 14 09:19:32 2023 +0100
@@ -14,16 +14,6 @@
 
 USER libervia
 
-RUN ./entrypoint.sh \
-    # we create the file sharing component which will autoconnect when backend is started
-    libervia-cli profile create file-sharing -j files.server1.test -p "" --xmpp-password test_e2e -C file-sharing -A && \
-    libervia-backend stop
-
-RUN ./entrypoint.sh \
-    # and a demo account
-    libervia-cli profile create demo -j demo@server1.test -p "demo"  && \
-    libervia-backend stop
-
 COPY --chown=libervia:libervia forums.json /home/libervia/
 COPY --chown=libervia:libervia scripts/init_script.sh /home/libervia/
 
--- a/docker/backend-dev-demo/scripts/init_script.sh	Wed Dec 13 22:00:25 2023 +0100
+++ b/docker/backend-dev-demo/scripts/init_script.sh	Thu Dec 14 09:19:32 2023 +0100
@@ -6,6 +6,14 @@
 if [ ! -f "$SETUP_INDICATOR" ]; then
     echo "First run detected. Setting up the environment and configuration."
 
+    # we create the file sharing component which will autoconnect when backend is started
+    libervia-cli profile create file-sharing -j files.server1.test -p "" --xmpp-password test_e2e -C file-sharing -A
+    # we have to be sure that file-sharing is connected before demo account,
+    # otherwise disco will be cached without it, and feature such as file
+    # sharing won't be available.
+    libervia-cli profile connect -cp file-sharing
+    # create a demo account
+    libervia-cli profile create demo -j demo@server1.test -p "demo"
     libervia-cli profile modify -D -cp demo --pwd demo
     libervia-cli forums set -p demo < $FORUMS_JSON_FILE
     libervia-cli bookmarks add -pdemo -a demo@chat.server1.test