From 6e6d66ed87a7c3b1704088962241e31e4758f573 Mon Sep 17 00:00:00 2001 From: Robert Hafner Date: Wed, 4 Dec 2013 23:36:48 -0800 Subject: [PATCH] Created environment setup wrapper script This script makes setting up the environment for testing easier. It detects that it's on travis and creates the appropriate setup right there, or on personal machines uses vagrant. If vagrant is running is skips the full setup and simply resets the mailbox for fast testing. --- tests/SetupEnvironment.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 tests/SetupEnvironment.sh diff --git a/tests/SetupEnvironment.sh b/tests/SetupEnvironment.sh new file mode 100755 index 0000000..7f3e72c --- /dev/null +++ b/tests/SetupEnvironment.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if [ -n "$TRAVIS" ]; then + + echo 'Travis config not yet written' + cp -Rp $DIR/resources /resources + /bin/bash /resources/Scripts/Provision.sh + +else + + # Since not in travis, lets load up a system with vagrant + + cd $DIR/vagrant + + VAGRANTSTATUS=$(vagrant status) + + # If vagrant is running already, reprovision it so it has fresh email boxes. + if echo "$VAGRANTSTATUS" | egrep -q "running" ; then + vagrant provision + else + vagrant up --provision + fi + cd $DIR + +fi \ No newline at end of file