Skip to content

Commit c936379

Browse files
committed
Display steps completion summary
Print out a JSON summary of the statuses of completed tasks. The summary is wrapped in a `SUMMARY_EYECATCHER` so it can be used in the UI. Example output: SUMMARY_EYECATCHER_BEGIN { "results": [ { "name": "foo", "result": "succeeded" }, { "name": "bar", "result": "failed" } ] } SUMMARY_EYECATCHER_END Signed-off-by: Tomáš Nevrlka <[email protected]>
1 parent 4093170 commit c936379

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

rhtap/summary.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ function cosignTree() {
3434
cosign tree $URL
3535
}
3636

37+
echo "SUMMARY_EYECATCHER_BEGIN"
38+
39+
jq '{results: .}' -s < <(
40+
find "$BASE_RESULTS" -mindepth 2 -maxdepth 2 -name STATUS | while read -r status_file; do
41+
name=$(basename "$(dirname "$status_file")")
42+
result=$(tr '[:upper:]' '[:lower:]' < "$status_file")
43+
44+
jq -n --arg name "$name" --arg result "$result" \
45+
'{name: $name, result: $result}'
46+
done
47+
)
48+
49+
echo "SUMMARY_EYECATCHER_END"
50+
3751
# Task Steps
3852
appstudio-summary
3953
showTree $BASE_RESULTS

0 commit comments

Comments
 (0)