diff --git a/dev-tools/ci b/dev-tools/ci index 765d9a8bd0b..73f8c6b876e 100755 --- a/dev-tools/ci +++ b/dev-tools/ci @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This script is used as a single command to run the x-plugins tests. # # It will attempt to check out 'elasticsearch' into a sibling directory @@ -13,9 +13,7 @@ # Turn on semi-strict mode set -e -if [ -n "$BASH" ]; then - set -o pipefail -fi +set -o pipefail # Allow the user choose different test through a single cli arg # default to `check` if no argument has been supplied @@ -23,12 +21,12 @@ key=${1-check} case $key in packagingTest) GRADLE_OPT_STRING="--info -Pvagrant.boxes=all :x-plugins:qa:vagrant:packagingTest" - break;; + ;; check) GRADLE_OPT_STRING="--info check -Dtests.network=true -Dtests.badapples=true" - break;; + ;; *) - echo "Unsupported cli argument $1. Allowed parameters are packagingTest or check. No argument defaults to check." + echo "Unsupported cli argument $1. Allowed arguments are packagingTest or check. No argument defaults to check." exit 1;; esac @@ -36,23 +34,23 @@ SCRIPT="$0" # SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` + ls=$(ls -ld "$SCRIPT") # Drop everything prior to -> - link=`expr "$ls" : '.*-> \(.*\)$'` + link=$(expr "$ls" : '.*-> \(.*\)$') if expr "$link" : '/.*' > /dev/null; then SCRIPT="$link" else - SCRIPT=`dirname "$SCRIPT"`/"$link" + SCRIPT=$(dirname "$SCRIPT")/"$link" fi done # determine base directory -BASE_DIR=`dirname "$SCRIPT"`/.. +BASE_DIR=$(dirname "$SCRIPT")/.. # make BASE_DIR absolute -BASE_DIR=`cd "$BASE_DIR"; pwd` +BASE_DIR=$(cd "$BASE_DIR"; pwd) -PARENT_DIR=`cd "$BASE_DIR"/..; pwd` +PARENT_DIR=$(cd "$BASE_DIR"/..; pwd) # go to the parent directory cd $PARENT_DIR