File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -219,23 +219,23 @@ function docker_build_with_version {
219
219
220
220
command=" docker build ${BUILD_OPTIONS} -f $dockerfile ${DOCKER_BUILD_CONTEXT} "
221
221
echo " -> building using $command "
222
-
223
222
tmp_file=$( mktemp " /tmp/${dir} -${OS} .XXXXXX" )
224
223
$command 2>&1 | tee " $tmp_file "
225
224
cat " $tmp_file "
226
225
last_row=$( < " $tmp_file " tail -n 1)
227
- commit_message=$( < " $tmp_file " tail -n 3)
228
226
# Structure of log build is as follows:
229
227
# COMMIT
230
228
# --> e191d12b5928
231
229
# e191d12b5928360dd6024fe80d31e08f994d42577f76b9b143e014749afc8ab4
232
230
# shellcheck disable=SC2016
233
- if [[ " $commit_message " == * " COMMIT " * ]] && [[ " $ last_row" =~ (^--> )? (Using cache )? [a-fA-F0-9]+$ ]]; then
231
+ if [[ " $last_row " =~ (^--> )? (Using cache )? [a-fA-F0-9]+$ ]]; then
234
232
IMAGE_ID=" $last_row "
235
233
else
236
- # Do not fail in case of sending log to pastebin or logdetective fails.
237
- echo " Analyse logs by logdetective, why it failed."
238
- analyze_logs_by_logdetective " ${tmp_file} "
234
+ if [[ " ${OS} " == " rhel8" ]] || [[ " ${OS} " == " rhel9" ]] || [[ " ${OS} " == " rhel10" ]]; then
235
+ # Do not fail in case of sending log to pastebin or logdetective fails.
236
+ echo " Analyse logs by logdetective, why it failed."
237
+ analyze_logs_by_logdetective " ${tmp_file} "
238
+ fi
239
239
exit 1
240
240
fi
241
241
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ failed_version() {
25
25
}
26
26
27
27
analyze_logs_by_logdetective () {
28
+ set +e
28
29
local log_file_name=" $1 "
29
30
echo " Sending failed log by fpaste command to paste bin."
30
31
paste_bin_link=$( fpaste " $log_file_name " )
@@ -43,6 +44,7 @@ analyze_logs_by_logdetective() {
43
44
echo " ERROR: Failed to analyze log file by logdetective server."
44
45
cat " /tmp/logdetective_test_output.txt"
45
46
echo " -------- LOGDETECTIVE TEST LOG ANALYSIS FAILED --------"
47
+ set -e
46
48
return
47
49
fi
48
50
jq -rC ' .explanation.text' < " /tmp/logdetective_test_output.txt"
@@ -75,7 +77,9 @@ for dir in ${VERSIONS}; do
75
77
tmp_file=$( mktemp " /tmp/${IMAGE_NAME} -${OS} -${dir} .XXXXXX" )
76
78
VERSION=$dir test/run 2>&1 | tee " $tmp_file "
77
79
ret_code=$?
78
- analyze_logs_by_logdetective " $tmp_file "
80
+ if [[ " ${OS} " == " rhel8" ]] || [[ " ${OS} " == " rhel9" ]] || [[ " ${OS} " == " rhel10" ]]; then
81
+ analyze_logs_by_logdetective " $tmp_file "
82
+ fi
79
83
failed_version " $ret_code " " $dir "
80
84
rm -f " $tmp_file "
81
85
fi
You can’t perform that action at this time.
0 commit comments