Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use set -e in build script #229

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions build-layer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e

# Copyright Splunk Inc.
#
Expand All @@ -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

Expand All @@ -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
make