summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2022-08-15 09:16:01 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2022-08-15 09:16:12 +0000
commitaa4b27a2927217b8d5fe6f06399a2317518f30b7 (patch)
tree4ca6dbeba5a35521c83e0d0eabe30fae5008e77a
parent3c3ee38c8d05f3935d2a904ade8c6509f65b878b (diff)
jenkins-scripts.sh: Output better comments in artifacts/results
... by run_step(). Change-Id: I57917730a714bac6c7713a6ebf38d68b9123b70f
-rw-r--r--jenkins-helpers.sh25
1 files changed, 16 insertions, 9 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index db9169d0..68969a05 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -1339,12 +1339,6 @@ run_step ()
done
pretty_step=$(echo "$pretty_step" | tr " /" "-")
- if [ x"$success_result" != x"x" ]; then
- cat >> $run_step_top_artifacts/results <<EOF
-# ${step[@]}:
-EOF
- fi
-
run_step_count=$(($run_step_count+1))
# Start running steps if:
@@ -1352,8 +1346,8 @@ EOF
# we haven't run any steps yet and
# there is no set starting step
if [ x"$pretty_step" = x"$run_step_start_at" ] || \
- ( [ x"$run_step_start_at" = x"" ] && \
- [ x"$run_step_prev_step" = x"" ] ); then
+ ( [ x"$run_step_start_at" = x"" ] && \
+ [ x"$run_step_prev_step" = x"" ] ); then
run_step_active=true
fi
@@ -1381,6 +1375,12 @@ EOF
esac
if ! $skip; then
+ if [ x"$success_result" != x"x" ]; then
+ cat >> $run_step_top_artifacts/results <<EOF
+# ${step[@]}:
+EOF
+ fi
+
local full_step_name
full_step_name=$(printf "%02d" $run_step_count)-$pretty_step
# This is used when accessing the workspace
@@ -1400,6 +1400,13 @@ EOF
wait $! || run_step_status=$?
xz $run_step_artifacts/console.log
+ if [ x"$success_result" != x"x" ] \
+ && [ x"$run_step_status" != x"0" ]; then
+ cat >> $run_step_top_artifacts/results <<EOF
+# FAILED
+EOF
+ fi
+
case "$run_step_status:$run_mode" in
0:*) ;;
$EXTERNAL_FAIL:stop_on_fail|$EXTERNAL_FAIL:reset_on_fail)
@@ -1421,7 +1428,7 @@ EOF
echo "SKIPPING ${step[*]}"
fi
- if [ x"$run_step_status" = x"0" ] && [ x"$success_result" != x"x" ]; then
+ if [ x"$success_result" != x"x" ] && [ x"$run_step_status" = x"0" ]; then
cat >> $run_step_top_artifacts/results <<EOF
$success_result
EOF