summaryrefslogtreecommitdiff
path: root/scripts/docker/Makefile
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/Makefile
parent3e4870f8bd6186f3d0821f392a0dafc5d5247ad4 (diff)
[test] add files to create docker image
Diffstat (limited to 'scripts/docker/Makefile')
-rw-r--r--scripts/docker/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/docker/Makefile b/scripts/docker/Makefile
new file mode 100644
index 00000000..7a80fe02
--- /dev/null
+++ b/scripts/docker/Makefile
@@ -0,0 +1,30 @@
+#/usr/bin/env
+
+IMAGE_NAME = "leap/soledad:1.0"
+
+all: image
+
+image:
+ docker build -t $(IMAGE_NAME) .
+
+run-server: image
+ rm -f $(CONTAINER_ID_FILE)
+ docker run \
+ --env="SOLEDAD_REMOTE=https://0xacab.org/leap/soledad.git" \
+ --env="SOLEDAD_BRANCH=develop" \
+ --cidfile=$(CONTAINER_ID_FILE) \
+ --detach \
+ $(IMAGE_NAME) \
+ /usr/local/soledad/start-server.sh
+
+# TODO: the following rule does not work for now, we have to add a
+# `start-test.sh` file
+run-test: image
+ container_id=`cat $(CONTAINER_ID_FILE)`; \
+ server_ip=`./helper/get-container-ip.sh $${container_id}`; \
+ docker run \
+ --env="SOLEDAD_REMOTE=https://0xacab.org/leap/soledad.git" \
+ --env="SOLEDAD_BRANCH=develop" \
+ --env="SOLEDAD_SERVER_IP=$${server_ip}" \
+ $(IMAGE_NAME) \
+ /usr/local/soledad/start-test.sh