Skip to content

Commit 9de9b71

Browse files
DAOS-623 cq: skip jenkinsfile hook if URL not accessible (#14121)
build.hpdd.intel.com is not accessible externally. Ideally githooks should not use network calls at all but workaround this for now by skipping. Signed-off-by: Dalton Bohning <[email protected]>
1 parent cd92282 commit 9de9b71

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

utils/githooks/pre-commit.d/20-Jenkinsfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ HOST="${HOST:-build.hpdd.intel.com}"
2020
CURL_VERBOSE=${CURL_VERBOSE:-""}
2121
CURL_PROXY="${CURL_PROXY:+-x }${CURL_PROXY:-}"
2222
CURL_OPTS="$CURL_PROXY $CURL_VERBOSE -s"
23-
if ! output=$(curl $CURL_OPTS -s -X POST -F "jenkinsfile=<${1:-Jenkinsfile}" https://$HOST//pipeline-model-converter/validate); then
24-
echo "Failed to check Jenkinsfile"
25-
exit 1
23+
URL="https://$HOST/pipeline-model-converter/validate"
24+
if ! output=$(curl $CURL_OPTS -s -X POST -F "jenkinsfile=<${1:-Jenkinsfile}" "$URL"); then
25+
echo " Failed to access $URL. Skipping Jenkinsfile check"
26+
exit 0
2627
fi
2728

2829
if echo "$output" | grep -q "Errors encountered validating"; then

0 commit comments

Comments
 (0)