Skip to content

Commit

Permalink
Wait for docker base on env RUNNER_WAIT_FOR_DOCKER_IN_SECONDS. (#2440)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingluoHuang committed Feb 15, 2023
1 parent 0c42dc1 commit b3492cb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Misc/layoutroot/run-helper.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Wait for docker to start
if [ ! -z "$RUNNER_WAIT_FOR_DOCKER_IN_SECONDS" ]; then
if [ "$RUNNER_WAIT_FOR_DOCKER_IN_SECONDS" -gt 0 ]; then
echo "Waiting for docker to be ready."
for i in $(seq "$RUNNER_WAIT_FOR_DOCKER_IN_SECONDS"); do
if docker ps > /dev/null 2>&1; then
echo "Docker is ready."
break
fi
"$DIR"/safe_sleep.sh 1
done
fi
fi

updateFile="update.finished"
"$DIR"/bin/Runner.Listener run $*

Expand Down

0 comments on commit b3492cb

Please sign in to comment.