Skip to content

Commit

Permalink
Wait until elasticsearch is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian committed Nov 17, 2011
1 parent b7f089f commit dd9ecdd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
language: php

before_script:
- wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.4.tar.gz
- tar -xzf elasticsearch-0.18.4.tar.gz
- elasticsearch-0.18.4/bin/elasticsearch &
before_script: ./test/bin/run_elasticsearch.sh

script: phpunit -c test/
14 changes: 14 additions & 0 deletions test/bin/run_elasticsearch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.4.tar.gz
tar -xzf elasticsearch-0.18.4.tar.gz
elasticsearch-0.18.4/bin/elasticsearch &

echo "Waiting until elasticsearch is ready on port 9200"
while [[ -z `curl -s 'http://localhost:9200' ` ]]
do
echo -n "."
sleep 2s
done

echo "elasticsearch is up"

0 comments on commit dd9ecdd

Please sign in to comment.