mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Give more options for testing with ruby while waiting for port
Try system ruby, then LS_HOME/bin/ruby, then relative path from script to LS_HOME/bin/ruby. Use LS_RUBY_HOME variable to avoid testing again on subsequent attempts to wait for port.
This commit is contained in:
parent
efc31ff842
commit
20a30f823a
1 changed files with 13 additions and 1 deletions
|
@ -35,7 +35,19 @@ test_port_nc() {
|
|||
}
|
||||
|
||||
test_port_ruby() {
|
||||
ruby -rsocket -e "TCPSocket.new('localhost', $1) rescue exit(1)"
|
||||
if command -v ruby 2>/dev/null; then
|
||||
ruby -rsocket -e "TCPSocket.new('localhost', $1) rescue exit(1)"
|
||||
else
|
||||
if [[ -z $LS_RUBY_HOME ]]; then
|
||||
if [[ -n $LS_HOME ]]; then
|
||||
LS_RUBY_HOME=$LS_HOME
|
||||
else
|
||||
LS_RUBY_HOME=$current_dir/../../..
|
||||
fi
|
||||
echo "Setting logstash ruby home to $LS_RUBY_HOME"
|
||||
fi
|
||||
$LS_RUBY_HOME/bin/ruby -rsocket -e "TCPSocket.new('localhost', $1) rescue exit(1)"
|
||||
fi
|
||||
}
|
||||
|
||||
clean_install_dir() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue