Add "Supported architectures" section

This commit is contained in:
Tianon Gravi 2017-10-02 13:27:23 -07:00
parent 72ceaca5f8
commit c87c899907
3 changed files with 38 additions and 0 deletions

30
.template-helpers/arches.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -Eeuo pipefail
repo="${1:-}"
if [ -z "$repo" ]; then
echo >&2 "usage: $0 repo"
echo >&2 " ie: $0 hylang"
exit 1
fi
# if we haven't set BASHBREW_LIBRARY explicitly (like Jenkins does, for example), don't trust the local library
if [ -z "${BASHBREW_LIBRARY:-}" ]; then
repo="https://github.com/docker-library/official-images/raw/master/library/$repo"
fi
bashbrew cat --format '
{{- range .Entries -}}
{{- range .Architectures -}}
{{- $ns := archNamespace . -}}
{{- if $ns -}}
[
{{- end -}}
`{{- . -}}`
{{- if $ns -}}
](https://hub.docker.com/r/{{- $ns -}}/{{- $.RepoName -}}/)
{{- end -}}
{{- ",\n" -}}
{{- end -}}
{{- end -}}
' "$repo" | sort -u | tr '\n' ' ' | sed 's/, $/\n/'

View File

@ -13,6 +13,9 @@
- **Maintained by**: - **Maintained by**:
%%MAINTAINER%% %%MAINTAINER%%
- **Supported architectures**: ([more info](https://github.com/docker-library/official-images#architectures-other-than-amd64))
%%ARCHES%%
- **Published image artifact details**: - **Published image artifact details**:
[repo-info repo's `repos/%%REPO%%/` directory](https://github.com/docker-library/repo-info/blob/master/repos/%%REPO%%) ([history](https://github.com/docker-library/repo-info/commits/master/repos/%%REPO%%)) [repo-info repo's `repos/%%REPO%%/` directory](https://github.com/docker-library/repo-info/blob/master/repos/%%REPO%%) ([history](https://github.com/docker-library/repo-info/commits/master/repos/%%REPO%%))
(image metadata, transfer size, etc) (image metadata, transfer size, etc)

View File

@ -105,6 +105,11 @@ for image in "${images[@]}"; do
[ "$partial" ] [ "$partial" ]
replace_field "$targetFile" 'TAGS' "$partial" replace_field "$targetFile" 'TAGS' "$partial"
echo ' ARCHES => arches.sh "'"$repo"'"'
arches="$("$helperDir/arches.sh" "$repo")"
[ "$arches" ]
replace_field "$targetFile" 'ARCHES' "$arches"
echo ' CONTENT => '"$repo"'/content.md' echo ' CONTENT => '"$repo"'/content.md'
replace_field "$targetFile" 'CONTENT' "$(cat "$repo/content.md")" replace_field "$targetFile" 'CONTENT' "$(cat "$repo/content.md")"