fixed leaked vars in ci.sh

This commit is contained in:
Spencer Alger
2014-01-10 12:42:02 -07:00
parent 3223fb4a6d
commit 0f58beceda

View File

@ -28,10 +28,10 @@ function group {
# Do, log, and check a call # Do, log, and check a call
##### #####
function call { function call {
DO="$*" local DO="$*"
echo -e "\$ ${DO}" echo "\$ ${DO}"
echo $DO | bash echo $DO | bash
RESULT=$? local RESULT=$?
if [ "$RESULT" -gt "0" ]; then if [ "$RESULT" -gt "0" ]; then
echo "non-zero exit code: $RESULT" echo "non-zero exit code: $RESULT"
exit $RESULT exit $RESULT
@ -39,10 +39,10 @@ function call {
} }
##### #####
# call grunt, but make sure it exists first # call grunt, but make sure it's installed first
##### #####
function grunt_ { function grunt_ {
DO="$*" local DO="$*"
if [ ! -x "`which grunt`" ]; then if [ ! -x "`which grunt`" ]; then
group "start:install_grunt" group "start:install_grunt"
@ -61,32 +61,32 @@ function grunt_ {
##### #####
function get_es { function get_es {
group "start:setup_es" group "start:setup_es"
ES_BRANCH=$1 local ES_BRANCH=$1
ES_RELEASE=$2 local ES_RELEASE=$2
ROOT="$PWD" local ROOT="$PWD"
ES_SUBMODULE="$ROOT/src/elasticsearch" local ES_SUBMODULE="$ROOT/src/elasticsearch"
SNAPSHOTS="$ROOT/.snapshots" local SNAPSHOTS="$ROOT/.snapshots"
if [ ! -d "$SNAPSHOTS" ]; then if [ ! -d "$SNAPSHOTS" ]; then
mkdir -p $SNAPSHOTS mkdir -p $SNAPSHOTS
fi fi
if [ -n "$ES_RELEASE" ]; then if [ -n "$ES_RELEASE" ]; then
ES_VERSION="v${ES_RELEASE}" local ES_VERSION="v${ES_RELEASE}"
ES_URL="https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ES_RELEASE}.zip" local ES_URL="https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ES_RELEASE}.zip"
ES_DIR="${SNAPSHOTS}/${ES_VERSION}" local ES_DIR="${SNAPSHOTS}/${ES_VERSION}"
else else
ES_VERSION="${ES_BRANCH}_nightly" local ES_VERSION="${ES_BRANCH}_nightly"
ES_URL="http://s3-us-west-2.amazonaws.com/build.elasticsearch.org/origin/$ES_BRANCH/nightly/JDK6/elasticsearch-latest-SNAPSHOT.zip" local ES_URL="http://s3-us-west-2.amazonaws.com/build.elasticsearch.org/origin/$ES_BRANCH/nightly/JDK6/elasticsearch-latest-SNAPSHOT.zip"
DATE=`date +%Y_%m_%d` local DATE=`date +%Y_%m_%d`
ES_DIR="${SNAPSHOTS}/${ES_VERSION}_${DATE}" local ES_DIR="${SNAPSHOTS}/${ES_VERSION}_${DATE}"
if [ ! -d $ES_DIR ]; then if [ ! -d $ES_DIR ]; then
call rm -rf ${SNAPSHOTS}/${ES_VERSION}* call rm -rf ${SNAPSHOTS}/${ES_VERSION}*
fi fi
fi fi
ES_BIN="$ES_DIR/bin/elasticsearch" local ES_BIN="$ES_DIR/bin/elasticsearch"
call cd $SNAPSHOTS call cd $SNAPSHOTS