diff --git a/build-layer.sh b/build-layer.sh index dd1e139..77dd13b 100755 --- a/build-layer.sh +++ b/build-layer.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # Copyright Splunk Inc. # @@ -19,7 +19,9 @@ echo "Installing dependencies" [[ -d /go/pkg/mod/cache ]] && exit 0 # retry up to 3 times in case of network issues for i in $(seq 1 3); do + set +e go mod download && break + set -e sleep 10 done @@ -33,4 +35,4 @@ CGO_ENABLED=0 gotestsum --format short-verbose --junitfile ~/testresults/unit.xm # package the layer echo "Packaging the layer" apt update && apt install --assume-yes zip -make \ No newline at end of file +make