From ce2ff5ff9940de855bbe34a499de361d67390426 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Wed, 15 Jan 2014 01:43:16 -0700 Subject: [PATCH] tweaked the ci script and prevented the manage_es fcuntion from returning before it can close the opened groups --- .travis.yml | 8 +------- scripts/_utils.sh | 36 +++++++++++++++++------------------- scripts/ci.sh | 2 ++ 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40a806eba..4c096dfab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,5 @@ language: node_js node_js: false -env: - global: - - SAUCE_ACCESS_KEY=3259dd1e-a9f2-41cc-afd7-855d80588aeb - - SAUCE_USERNAME=elasticsearch-js matrix: include: - node_js: "0.8" @@ -11,11 +7,9 @@ matrix: - node_js: "0.10" env: ES_BRANCH=master COVERAGE=1 - node_js: "0.10" - env: ES_BRANCH=0.90 NODE_UNIT=0 + env: ES_RELEASE=0.90.10 ES_BRANCH=0.90 NODE_UNIT=0 - node_js: "0.10" env: ES_RELEASE=0.90.9 ES_BRANCH=0.90 NODE_UNIT=0 - - node_js: "0.10" - env: ES_RELEASE=0.90.8 ES_BRANCH=0.90 NODE_UNIT=0 # - node_js: "0.10" # env: NODE_UNIT=0 NODE_INTEGRATION=0 TEST_BROWSER='chrome' # - node_js: "0.10" diff --git a/scripts/_utils.sh b/scripts/_utils.sh index 7ff3e0ec2..979907f3c 100644 --- a/scripts/_utils.sh +++ b/scripts/_utils.sh @@ -37,7 +37,6 @@ function manage_es { local PIDS="$ROOT/.snapshots/pids" group "start:$DO es" - if [ ! -d "$PIDS" ]; then call mkdir -p $PIDS fi @@ -82,32 +81,30 @@ function manage_es { if [ $RUNNING -eq 0 ]; then echo "Already running $ES_VERSION" - return 1 else echo "PID file was left behind by ES" call rm $PIDFILE fi fi - ./scripts/es.sh install $ES_BRANCH $ES_RELEASE - if [ ! -x "$ES_BIN" ]; then echo "Unable to find elasticsearch executable" - return 1 - fi + elif [ ! -f $PIDFILE ]; then + ./scripts/es.sh install $ES_BRANCH $ES_RELEASE - local ES_OPTS="-p $PIDFILE -Des.network.host=localhost -Des.discovery.zen.ping.multicast.enabled=false -Des.discovery.zen.ping_timeout=1" + local ES_OPTS="-p $PIDFILE -Des.network.host=localhost -Des.discovery.zen.ping.multicast.enabled=false -Des.discovery.zen.ping_timeout=1" - if [ -n "$ES_NODE_NAME" ]; then - ES_OPTS="$ES_OPTS -Des.node.name=$ES_NODE_NAME" - fi + if [ -n "$ES_NODE_NAME" ]; then + ES_OPTS="$ES_OPTS -Des.node.name=$ES_NODE_NAME" + fi - if [ "$ES_BRANCH" = "0.90" ]; then - echo "Starting Elasticsearch $ES_VERSION" - call $ES_BIN $ES_OPTS - else - echo "Starting Elasticsearch $ES_VERSION as a deamon" - call $ES_BIN -d $ES_OPTS + if [ "$ES_BRANCH" = "0.90" ]; then + echo "Starting Elasticsearch $ES_VERSION" + call $ES_BIN $ES_OPTS + else + echo "Starting Elasticsearch $ES_VERSION as a deamon" + call $ES_BIN -d $ES_OPTS + fi fi ;; stop) @@ -119,13 +116,14 @@ function manage_es { if [ $RUNNING -eq 0 ]; then kill $PID echo "Elasticsearch $ES_VERSION stopped" - return 0 + else + echo "PID file was left behind by ES" fi rm $PIDFILE + else + echo "Elasticsearch $ES_VERSION is not running." fi - echo "Elasticsearch $ES_VERSION is not running." - return 1 ;; esac group "end:$DO es" diff --git a/scripts/ci.sh b/scripts/ci.sh index 6a30a7e80..9b152a960 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -17,6 +17,8 @@ HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ES_NODE_NAME="elasticsearch_js_test_runner" +SAUCE_ACCESS_KEY="3259dd1e-a9f2-41cc-afd7-855d80588aeb" +SAUCE_USERNAME="elasticsearch-js" source $HERE/_utils.sh