From 9584dbcdbd03ef046ebb481524c62ddd48805996 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Fri, 16 Aug 2024 17:04:29 +0100 Subject: [PATCH] fix(db-init): github check, sh version Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay/templates/job.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/helmcharts/openreplay/templates/job.yaml b/scripts/helmcharts/openreplay/templates/job.yaml index ef8e157df..c0618e1d5 100644 --- a/scripts/helmcharts/openreplay/templates/job.yaml +++ b/scripts/helmcharts/openreplay/templates/job.yaml @@ -59,15 +59,16 @@ spec: set -x mkdir -p /opt/openreplay/openreplay && cd /opt/openreplay/openreplay - # Function to check if GitHub is available check_github() { - for i in {1..10}; do - if ping -c 1 github.com &> /dev/null; then + i=0 + while [ $i -lt 10 ]; do + if ping -c 1 github.com >/dev/null 2>&1; then echo "GitHub is available." git clone {{ .Values.global.dbMigrationUpstreamRepoURL | default "https://github.com/openreplay/openreplay" }} . break else echo "GitHub is not available. Retrying in 3 seconds..." + i=$((i+1)) sleep 3 fi done