Skip to content

Commit 398f3ec

Browse files
committed
ci: fix failed ISO not commenting on PR
1 parent 574f958 commit 398f3ec

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

hack/jenkins/build_iso.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,20 @@ else
6565
export ISO_BUCKET
6666
fi
6767

68-
make release-iso | tee iso-logs.txt
69-
# Abort with error message if above command failed
70-
ec=$?
71-
if [ $ec -gt 0 ]; then
72-
if [ "$release" = false ]; then
73-
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed.
74-
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
75-
"
76-
fi
77-
exit $ec
68+
if ! make release-iso 2>&1 | tee iso-logs.txt; then
69+
# Exit of `make` (PIPESTATUS[0]); fallback to 1 if unavailable
70+
ec=${PIPESTATUS[0]:-1}
71+
72+
# Only comment on non-release; default release=false if unset
73+
if [[ ${release:-false} != "true" ]]; then
74+
gh pr comment "${ghprbPullId}" --body "$(cat <<'MSG'
75+
Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed for Commit ${ghprbActualCommit}
76+
See the logs at:
77+
https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
78+
MSG
79+
)"
80+
fi
81+
exit "$ec"
7882
fi
7983

8084
git config user.name "minikube-bot"

0 commit comments

Comments
 (0)