Skip to content

Commit bf46976

Browse files
authored
Merge pull request #1195 from infosiftr/per-arch-build-status
Add per-arch build-status badges
2 parents 9aea88a + 7c25185 commit bf46976

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

generate-repo-stub-readme.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ if wget -q --spider "$jenkinsImage" &> /dev/null; then
7575
badges+=( "-${t}[Automated \`update.sh\`: ${n}${t}![build status badge]($jenkinsImage)]($jenkinsLink)" )
7676
fi
7777

78+
arches="$(bashbrew cat --format '{{ range .Entries }}{{ join "\n" .Architectures }}{{ "\n" }}{{ end }}' "https://github.com/docker-library/official-images/raw/master/library/$repo" | sort -u)"
79+
if [ -n "$arches" ]; then
80+
archTable=
81+
i=0
82+
for arch in $arches; do
83+
jenkinsLink="https://doi-janky.infosiftr.net/job/multiarch/job/$arch/job/$repo"
84+
jenkinsImage="$jenkinsLink/badge/icon"
85+
if wget -q --spider "$jenkinsImage" &> /dev/null; then
86+
archTable="${archTable:-|} [\`$arch\`<br />![build status badge]($jenkinsImage)]($jenkinsLink) |"
87+
(( i = (i + 1) % 4 )) || : # modulo here needs to match the number of colums used below
88+
if [ "$i" = 0 ]; then
89+
archTable+="${n}|"
90+
fi
91+
fi
92+
done
93+
if [ -n "$archTable" ]; then
94+
badges+=( "${n}| Build | Status | Badges | (per-arch) |${n}|:-:|:-:|:-:|:-:|${n}${archTable%${n}|}" )
95+
fi
96+
fi
97+
7898
if [ "${#badges[@]}" -gt 0 ]; then
7999
IFS=$'\n'
80100
cat <<-EOREADME

0 commit comments

Comments
 (0)