Merge pull request #962 from infosiftr/arch-specific-docs

Update docs to filter arch-specific content a bit better (variants, supported tags)
This commit is contained in:
yosifkit 2017-07-13 09:43:52 -07:00 committed by GitHub
commit 75158bbf34
3 changed files with 23 additions and 2 deletions

View File

@ -4,8 +4,11 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
*/ -}}
{{- $archSpecific := getenv "ARCH_SPECIFIC_DOCS" -}}
{{- range $i, $e := $.Entries -}}
{{- $arch := ternary (ternary arch ($e.Architectures | first) ($e.HasArchitecture arch)) arch (eq arch "amd64") -}}
{{- $arch := $archSpecific | ternary arch ($e.HasArchitecture arch | ternary arch ($e.Architectures | first)) -}}
{{- if $e.HasArchitecture $arch -}}
{{- /* force bashbrew to "fetch" the GitCommit so that it is fully resolved */ -}}
{{- $from := $.ArchDockerFrom $arch $e -}}

View File

@ -17,7 +17,18 @@ if [ -z "${BASHBREW_LIBRARY:-}" ]; then
fi
IFS=$'\n'
tags=( $(bashbrew cat -f '{{ range .Entries }}{{ join "\n" .Tags }}{{ "\n" }}{{ end }}' "$repo") )
tags=( $(bashbrew cat -f '
{{- $archSpecific := getenv "ARCH_SPECIFIC_DOCS" -}}
{{- range .Entries -}}
{{- $arch := $archSpecific | ternary arch (.HasArchitecture arch | ternary arch (.Architectures | first)) -}}
{{- if .HasArchitecture $arch -}}
{{- join "\n" .Tags -}}
{{- "\n" -}}
{{- end -}}
{{- end -}}
' "$repo") )
unset IFS
text=

View File

@ -25,6 +25,13 @@ for image in "${images[@]}"; do
namespace="${image%$repo}"
namespace="${namespace%/}"
# this is used by subscripts to determine whether we're pushing /_/xxx or /r/ARCH/xxx
# (especialy for "supported tags")
export ARCH_SPECIFIC_DOCS=
if [ -n "$namespace" ] && [ -n "${BASHBREW_ARCH:-}" ]; then
export ARCH_SPECIFIC_DOCS=1
fi
if [ -x "$repo/update.sh" ]; then
( set -x; "$repo/update.sh" "$image" )
fi