Add docker test script.
authorWard Vandewege <ward@curoverse.com>
Tue, 1 Jul 2014 15:41:17 +0000 (11:41 -0400)
committerWard Vandewege <ward@curoverse.com>
Tue, 1 Jul 2014 15:41:33 +0000 (11:41 -0400)
no issue #

jenkins/run-docker-tests.sh [new file with mode: 0755]

diff --git a/jenkins/run-docker-tests.sh b/jenkins/run-docker-tests.sh
new file mode 100755 (executable)
index 0000000..fc7f789
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+EXITCODE=0
+
+COLUMNS=80
+
+title () {
+  printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
+}
+
+echo $WORKSPACE
+
+# clean up existing docker containers and images
+docker.io stop $(docker.io ps -a -q)
+docker.io rm $(docker.io ps -a -q)
+docker.io rmi $(docker.io images -q)
+
+# clean up build files so we can re-build
+rm -f $WORKSPACE/docker/*-image
+
+rm -f docker/config.yml
+
+# Get test config.yml file
+cp $HOME/docker/config.yml docker/
+
+# DOCS
+title "Starting docker build"
+cd "$WORKSPACE"
+cd docker
+./build.sh
+
+ECODE=$?
+
+if [[ "$ECODE" != "0" ]]; then
+  title "!!!!!! docker BUILD FAILED !!!!!!"
+  EXITCODE=$(($EXITCODE + $ECODE))
+fi
+
+title "docker build complete"
+