fix(scheduler): add wait-for script for docker purposes
This commit is contained in:
parent
c9fd718af4
commit
23ced9427f
1 changed files with 17 additions and 0 deletions
17
packages/scheduler/wait-for.sh
Executable file
17
packages/scheduler/wait-for.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
host="$1"
|
||||
shift
|
||||
port="$1"
|
||||
shift
|
||||
cmd="$@"
|
||||
|
||||
while ! nc -vz $host $port; do
|
||||
>&2 echo "$host:$port is unavailable yet - waiting for it to start"
|
||||
sleep 10
|
||||
done
|
||||
|
||||
>&2 echo "$host:$port is up - executing command"
|
||||
exec $cmd
|
Loading…
Reference in a new issue