Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add option to exit runner if docker isn't available
  • Loading branch information
felixlut committed Mar 5, 2025
commit 5efed7903e1108bea1fc7209acef593192014cdc
6 changes: 6 additions & 0 deletions src/Misc/layoutroot/run-helper.sh.template
Original file line number Diff line number Diff line change
@@ -20,16 +20,22 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Wait for docker to start
if [ ! -z "$RUNNER_WAIT_FOR_DOCKER_IN_SECONDS" ]; then
RUNNER_WAIT_FOR_DOCKER_SUCCESS=false
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."
RUNNER_WAIT_FOR_DOCKER_SUCCESS=true
break
fi
"$DIR"/safe_sleep.sh 1
done
fi
if [[ ! -z "$RUNNER_WAIT_FOR_DOCKER_EXIT_ON_FAILURE" && $RUNNER_WAIT_FOR_DOCKER_SUCCESS == false ]]; then
echo "Docker is not ready, exiting..."
exit 1
fi
fi

updateFile="update.finished"