summaryrefslogtreecommitdiff
path: root/scripts/docker/files/setup-env.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/setup-env.sh
parent3e4870f8bd6186f3d0821f392a0dafc5d5247ad4 (diff)
[test] add files to create docker image
Diffstat (limited to 'scripts/docker/files/setup-env.sh')
-rwxr-xr-xscripts/docker/files/setup-env.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/docker/files/setup-env.sh b/scripts/docker/files/setup-env.sh
new file mode 100755
index 00000000..c98a6d08
--- /dev/null
+++ b/scripts/docker/files/setup-env.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Clone soledad repository and install soledad dependencies needed to run
+# client and server in a test environment.
+#
+# This script is meant to be copied to the docker container and run after
+# system dependencies have been installed.
+
+BASEDIR="/var/local"
+BASEURL="https://github.com/leapcode"
+
+mkdir -p ${BASEDIR}
+
+# clone repositories
+repos="soledad leap_pycommon"
+
+for repo in ${repos}; do
+ repodir=${BASEDIR}/${repo}
+ if [ ! -d ${repodir} ]; then
+ git clone ${BASEURL}/${repo} ${repodir}
+ git -C ${repodir} fetch origin
+ fi
+done
+
+# use latest pip because the version available in debian jessie doesn't
+# support wheels
+pip install -U pip
+
+pip install psutil
+
+# install dependencies and packages
+install_script="pkg/pip_install_requirements.sh"
+opts="--use-leap-wheels"
+pkgs="leap_pycommon soledad/common soledad/client soledad/server"
+
+for pkg in ${pkgs}; do
+ pkgdir=${BASEDIR}/${pkg}
+ testing=""
+ if [ -f ${pkgdir}/pkg/requirements-testing.pip ]; then
+ testing="--testing"
+ fi
+ (cd ${pkgdir} && ${install_script} ${testing} ${opts})
+ (cd ${pkgdir} && python setup.py develop)
+done