#!/bin/sh # Start a soledad server inside a docker container. # # This script will: # # - eventually checkout a specific branch from a specific soledad remote. # # - create everything a soledad server needs to run (certificate, backend # server database, tables, etc. # # - eventually preload the server database with a number of documents equal # to SOLEDAD_PRELOAD_NUM, and with payload size equal to # SOLEDAD_PRELOAD_SIZE. # # - run the soledad server. # # This script is meant to be copied to the docker container and run upon # container start. CMD="/usr/local/soledad/setup-test-env.py" #--------------------------------------------------------------------------- # eventually checkout a specific branch from a specific remote #--------------------------------------------------------------------------- REPO="/var/local/soledad" if [ ! -z "${SOLEDAD_REMOTE}" ]; then git -C ${REPO} remote set-url origin ${SOLEDAD_REMOTE} git -C ${REPO} fetch origin fi if [ ! -z "${SOLEDAD_BRANCH}" ]; then git -C ${REPO} checkout ${SOLEDAD_BRANCH} fi #--------------------------------------------------------------------------- # setup environment for running soledad server #--------------------------------------------------------------------------- ${CMD} couch start ${CMD} user-db create ${CMD} token-db create ${CMD} token-db insert-token ${CMD} shared-db create ${CMD} cert create #--------------------------------------------------------------------------- # write a configuration file for the perf test #--------------------------------------------------------------------------- if [ "${SOLEDAD_PRELOAD_NUM}" -gt 0 ]; then cd /var/local/soledad-perf cat > defaults.conf <