Implement "archFilter" to fix arch-specific "Shared Tags" lists
This commit is contained in:
parent
bd2deb9435
commit
4b0f219a2c
|
|
@ -11,10 +11,9 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
|
|||
{{- "## Simple Tags\n\n" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $i, $e := $.Entries -}}
|
||||
{{- range $i, $e := ($archSpecific | ternary (archFilter arch $.Entries) $.Entries) -}}
|
||||
{{- $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 -}}
|
||||
|
||||
|
|
@ -34,7 +33,6 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
|
|||
{{- $gitCommit := $e.ArchGitCommit $arch -}}
|
||||
{{- if $isGitHub -}} ]( {{- $repoUrlBase -}} /blob/ {{- $gitCommit -}} / {{- $dockerfilePath -}} ) {{- end -}}
|
||||
{{- /* TODO decide what to do (if anything) about non-GitHub repos with respect to URL */ -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- "\n\n" -}}
|
||||
|
||||
|
|
@ -42,13 +40,16 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
|
|||
{{- "## Shared Tags\n\n" -}}
|
||||
|
||||
{{- range $sharedTagGroups -}}
|
||||
{{- $entries := $archSpecific | ternary (archFilter arch .Entries) .Entries -}}
|
||||
|
||||
{{- if (len $entries) -}}
|
||||
{{- "-\t`" -}}
|
||||
{{ .SharedTags | join "`, `" }}
|
||||
{{- "`:\n" -}}
|
||||
{{- range $i, $e := .Entries -}}
|
||||
|
||||
{{- range $i, $e := $entries -}}
|
||||
{{- $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 -}}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,14 +42,12 @@ fi
|
|||
|
||||
bashbrewFetchTemplate='
|
||||
'"$templateHeader"'
|
||||
{{- range $i, $e := $.Entries -}}
|
||||
{{- range $i, $e := ($archSpecific | ternary (archFilter arch $.Entries) $.Entries) -}}
|
||||
'"$templateArchVar"'
|
||||
{{- if $e.HasArchitecture $arch -}}
|
||||
{{- join "/" "refs/tags" $arch $.RepoName ($e.Tags | first) -}}
|
||||
{{- ":" -}}
|
||||
{{- "\n" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
'
|
||||
|
||||
bashbrew cat --format "$bashbrewFetchTemplate" "$repo" \
|
||||
|
|
|
|||
|
|
@ -20,14 +20,10 @@ IFS=$'\n'
|
|||
tags=( $(bashbrew cat -f '
|
||||
{{- $archSpecific := getenv "ARCH_SPECIFIC_DOCS" -}}
|
||||
|
||||
{{- range .Entries -}}
|
||||
{{- $arch := $archSpecific | ternary arch (.HasArchitecture arch | ternary arch (.Architectures | first)) -}}
|
||||
|
||||
{{- if .HasArchitecture $arch -}}
|
||||
{{- range ($archSpecific | ternary (archFilter arch .Entries) .Entries) -}}
|
||||
{{- join "\n" .Tags -}}
|
||||
{{- "\n" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
' "$repo") )
|
||||
unset IFS
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue