diff launch_gnb.sh @ 0:22f22c3e81bf draft

planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
author gga
date Wed, 11 Jan 2023 11:49:13 +0000
parents
children f415e44e71de
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launch_gnb.sh	Wed Jan 11 11:49:13 2023 +0000
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+set -e
+
+mongod --dbpath ./mongo_db/ --unixSocketPrefix `pwd` --bind_ip fake_socket --logpath ./mongod.log --pidfilepath ./mongo.pid &
+
+sleep 5
+
+# "waiting for connections on port" is for mongodb 4x
+#if ! grep -q "waiting for connections on port" ./mongod.log; then
+# "Listening on" is for mongodb 5x
+if ! grep -q "Listening on" ./mongod.log; then
+  echo "Failed to launch MongoDB:" 1>&2;
+  cat ./mongod.log 1>&2;
+  kill $GNB_PID;
+  exit 1;
+fi;
+
+TMP_STORAGE=$(pwd)/tmp_storage
+mkdir "$TMP_STORAGE"
+
+genenotebook run --storage-path "$TMP_STORAGE" --port ${GNB_PORT} --mongo-url mongodb://$MONGO_URI%2Fmongodb-27017.sock/genenotebook > ./gnb.log 2>&1 &
+
+export GNB_PID=$!
+
+sleep 15
+
+if ! grep -q "GeneNoteBook server started, serving" ./gnb.log; then
+  echo "Failed to launch GeneNoteBook:" 1>&2;
+  cat ./gnb.log 1>&2;
+  kill $GNB_PID $(<"./mongo.pid");
+  exit 1;
+fi;