[openqa] Import entrypoint



commit 9161c5cae32ef55a45809b558c47cf2fe2d84749
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Thu Sep 23 14:14:24 2021 +0200

    Import entrypoint

 entrypoint | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
---
diff --git a/entrypoint b/entrypoint
new file mode 100755
index 0000000..3c57905
--- /dev/null
+++ b/entrypoint
@@ -0,0 +1,50 @@
+ch#!/bin/bash
+set -e
+
+function wait_for_db_creation() {
+  echo "Waiting for DB creation"
+  while ! $(su geekotest -c 'PGPASSWORD=openqa psql -h db -U openqa --list | grep -qe openqa'); do sleep .1; 
done
+}
+
+function scheduler() {
+  su geekotest -c /usr/share/openqa/script/openqa-scheduler-daemon
+}
+
+function websockets() {
+  su geekotest -c /usr/share/openqa/script/openqa-websockets-daemon
+}
+
+function gru() {
+  wait_for_db_creation
+  su geekotest -c /usr/share/openqa/script/openqa-gru
+}
+
+function livehandler() {
+  wait_for_db_creation
+  su geekotest -c /usr/share/openqa/script/openqa-livehandler-daemon
+}
+
+function webui() {
+  wait_for_db_creation
+  su geekotest -c /usr/share/openqa/script/openqa-webui-daemon
+}
+
+function all_together_apache() {
+  # run services
+  su geekotest -c /usr/share/openqa/script/openqa-scheduler-daemon &
+  su geekotest -c /usr/share/openqa/script/openqa-websockets-daemon &
+  su geekotest -c /usr/share/openqa/script/openqa-gru &
+  su geekotest -c /usr/share/openqa/script/openqa-livehandler-daemon &
+  apache2ctl start
+  su geekotest -c /usr/share/openqa/script/openqa-webui-daemon
+}
+
+# run services
+case "$MODE" in
+  scheduler ) scheduler;;
+  websockets ) websockets;;
+  gru ) gru;;
+  livehandler ) livehandler;;
+  webui ) webui;;
+  * ) all_together_apache;;
+esac


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]