From 343b3f5e6219eaa48e4f2550433f5b6366912fd8 Mon Sep 17 00:00:00 2001 From: Jonas Tobias Hopusch Date: Sun, 5 Dec 2021 16:57:55 +0100 Subject: [PATCH] Add script to run another once gitea is ready --- build-when-ready.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 build-when-ready.sh diff --git a/build-when-ready.sh b/build-when-ready.sh new file mode 100644 index 0000000..658aa36 --- /dev/null +++ b/build-when-ready.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -eu + +failcount=0 +until curl -X "GET" 'https://gitea.jotoho.de/api/v1/version' >/dev/null 2>&1; do + if [ "$failcount" -gt 300 ]; then + echo "Gitea timeout. Exiting!" + exit 1 + fi + sleep 1 + failcount=$(($failcount + 1)) +done + +sh $1