summaryrefslogtreecommitdiff
path: root/scripts/docker/files/start-server.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/docker/files/start-server.sh')
-rwxr-xr-xscripts/docker/files/start-server.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/docker/files/start-server.sh b/scripts/docker/files/start-server.sh
new file mode 100755
index 00000000..ea14aa5a
--- /dev/null
+++ b/scripts/docker/files/start-server.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Start a soledad server inside a docker container.
+#
+# This script is meant to be copied to the docker container and run upon
+# container start.
+
+CMD="/usr/local/soledad/test-env.py"
+REPO="/var/local/soledad"
+
+if [ ! -z "${SOLEDAD_REMOTE}" ]; then
+ git -C ${REPO} remote add test ${SOLEDAD_REMOTE}
+ git -C ${REPO} fetch test
+fi
+
+if [ ! -z "${SOLEDAD_BRANCH}" ]; then
+ git -C ${REPO} checkout ${SOLEDAD_BRANCH}
+fi
+
+${CMD} couch start
+${CMD} user-db create
+${CMD} token-db create
+${CMD} token-db insert-token
+${CMD} cert create
+${CMD} soledad-server start --no-daemonize