summaryrefslogtreecommitdiff
path: root/scripts/docker/files/start-server.sh
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-05-30 13:45:51 -0300
committerdrebs <drebs@leap.se>2016-06-06 21:40:37 -0300
commitf829832457237b7342e510e4112f66819be3ab3d (patch)
treefc682e18c9a1926d1c1198bd54bfeb70d82f1d65 /scripts/docker/files/start-server.sh
parent3e4870f8bd6186f3d0821f392a0dafc5d5247ad4 (diff)
[test] add files to create docker image
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