Skip to content

Commit

Permalink
fix(CI): update elastic_wait command usage
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Nov 20, 2019
1 parent 7a3088f commit bc2d83f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions scripts/elastic_wait.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
set -e

function elastic_status(){
curl --output /dev/null --silent --write-out "%{http_code}" "http://${ELASTIC_HOST:-localhost:9200}" || true;
curl \
--output /dev/null \
--silent \
--write-out "%{http_code}" \
"http://${ELASTIC_HOST:-localhost:9200}" || true;
}

function elastic_wait(){
Expand All @@ -9,7 +15,7 @@ function elastic_wait(){
i=1
while [[ "$i" -le "$retry_count" ]]; do
if [[ $(elastic_status) -eq 200 ]]; then
echo "Elasticsearch up!"
echo
exit 0
fi
sleep 2
Expand All @@ -20,4 +26,4 @@ function elastic_wait(){
echo
echo "Elasticsearch did not come up, check configuration"
exit 1
}
}
4 changes: 2 additions & 2 deletions scripts/setup_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
# wait for server to boot up
# logs show that on travis-ci it can take ~17s to boot an ES6 server
source "${BASH_SOURCE%/*}/elastic_wait.sh"
elastic_wait
(elastic_wait)

# set the correct esclient.apiVersion in pelias.json
v=( ${ES_VERSION//./ } ) # split version number on '.'
Expand All @@ -48,4 +48,4 @@ echo "--- pelias.json ---"
cat ~/pelias.json

echo "--- elasticsearch.yml ---"
cat /tmp/elasticsearch/config/elasticsearch.yml
cat /tmp/elasticsearch/config/elasticsearch.yml

0 comments on commit bc2d83f

Please sign in to comment.