Skip to content

Commit 3e3f775

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 a8d80ca commit 3e3f775

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rhtap/summary.sh

+15
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ function cosignTree() {
3434
cosign tree $URL
3535
}
3636

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

0 commit comments

Comments
 (0)