Skip to content

Commit

Permalink
travis: Restart zk until it works.
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Nottale <[email protected]>
  • Loading branch information
Matthieu Nottale committed Aug 10, 2017
1 parent 18a2759 commit 6fa608e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ before_script:
script:
- ./consul agent -server -bootstrap -advertise=127.0.0.1 -data-dir /tmp/consul -config-file=./config.json 1>/dev/null &
- ./etcd/etcd --listen-client-urls 'http://0.0.0.0:4001' --advertise-client-urls 'http://127.0.0.1:4001' >/dev/null 2>&1 &
- ./zk/bin/zkServer.sh start ./zk/conf/zoo.cfg 1> /dev/null
- ./script/travis_start_zk.sh
- ./memo/bin/memo kvs run kvs --allow-root-creation --grpc localhost:9000 >/dev/null 2>&1 &
- script/validate-gofmt
- go vet ./...
Expand Down
10 changes: 10 additions & 0 deletions script/travis_start_zk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

while true; do
./zk/bin/zkServer.sh start ./zk/conf/zoo.cfg
if echo stat |nc localhost 2181 |grep -q Mode; then
break
fi
echo zk did not start properly, retrying...
./zk/bin/zkServer.sh stop
done

0 comments on commit 6fa608e

Please sign in to comment.