mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
ci: make pushed images annotation collapsible (#61567)
Shrinks down the output from the "Push xyz images" buildkite annotation!   ## Test plan See screenshots above for tested results
This commit is contained in:
parent
47514c45cf
commit
f40ff8a7a2
@ -35,22 +35,22 @@ function echo_append_annotation() {
|
||||
if [ "$arg" != "--tag" ]; then
|
||||
if [ "$formatted_tags" == "" ]; then
|
||||
# Do not insert a comma for the first element
|
||||
formatted_tags="\`$arg\`"
|
||||
formatted_tags="<code>$arg</code>"
|
||||
else
|
||||
formatted_tags="${formatted_tags}, \`$arg\`"
|
||||
formatted_tags="${formatted_tags}, <code>$arg</code>"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
for reg in "${registries[@]}"; do
|
||||
if [ "$formatted_registries" == "" ]; then
|
||||
formatted_registries="\`$reg\`"
|
||||
formatted_registries="<code>$reg</code>"
|
||||
else
|
||||
formatted_registries="${formatted_registries}, \`$reg\`"
|
||||
formatted_registries="${formatted_registries}, <code>$reg</code>"
|
||||
fi
|
||||
done
|
||||
|
||||
raw="| ${repository} | ${formatted_registries} | ${formatted_tags} |"
|
||||
raw="<tr><td>${repository}</td><td>${formatted_registries}</td><td>${formatted_tags}</td></tr>"
|
||||
echo "echo -e '${raw}' >>./annotations/pushed_images.md"
|
||||
}
|
||||
|
||||
@ -146,15 +146,14 @@ fi
|
||||
|
||||
# Posting the preamble for image pushes.
|
||||
echo -e "### ${BUILDKITE_LABEL}" > ./annotations/pushed_images.md
|
||||
echo -e "\n| Name | Registries | Tags |\n|---|---|---|" >> ./annotations/pushed_images.md
|
||||
echo -e "<details><summary>Click to expand table</summary><table>\n" >>./annotations/pushed_images.md
|
||||
echo -e "<tr><th>Name</th><th>Registries</th><th>Tags</th></tr>\n" >> ./annotations/pushed_images.md
|
||||
|
||||
preview_tags "${dev_registries[*]}" "${dev_tags[*]}"
|
||||
if $push_prod; then
|
||||
preview_tags "${prod_registries[*]}" "${prod_tags[*]}"
|
||||
fi
|
||||
|
||||
echo "--- done"
|
||||
|
||||
dev_tags_args=""
|
||||
for t in "${dev_tags[@]}"; do
|
||||
dev_tags_args="$dev_tags_args --tag ${t}"
|
||||
@ -184,9 +183,8 @@ for target in ${images[@]}; do
|
||||
fi
|
||||
done
|
||||
|
||||
echo "-- jobfile"
|
||||
echo "--- :bash: Generated jobfile"
|
||||
cat "$job_file"
|
||||
echo "--- done"
|
||||
|
||||
echo "--- :bazel::docker: Pushing images..."
|
||||
log_file=$(mktemp)
|
||||
@ -211,6 +209,7 @@ while read -r line; do
|
||||
fi
|
||||
done <"$log_file"
|
||||
|
||||
echo -e "</table></details>" >>./annotations/pushed_images.md
|
||||
|
||||
echo "--- :bazel::docker: detailed summary"
|
||||
cat "$log_file"
|
||||
echo "--- done"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user