diff --git a/.template-helpers/arches.sh b/.template-helpers/arches.sh new file mode 100755 index 000000000..810095755 --- /dev/null +++ b/.template-helpers/arches.sh @@ -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/' diff --git a/.template-helpers/template.md b/.template-helpers/template.md index 32afabd15..5aabc8413 100644 --- a/.template-helpers/template.md +++ b/.template-helpers/template.md @@ -13,6 +13,9 @@ - **Maintained by**: %%MAINTAINER%% +- **Supported architectures**: ([more info](https://github.com/docker-library/official-images#architectures-other-than-amd64)) + %%ARCHES%% + - **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%%)) (image metadata, transfer size, etc) diff --git a/update.sh b/update.sh index f28a412c7..cae7a2898 100755 --- a/update.sh +++ b/update.sh @@ -105,6 +105,11 @@ for image in "${images[@]}"; do [ "$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' replace_field "$targetFile" 'CONTENT' "$(cat "$repo/content.md")"