summaryrefslogtreecommitdiffstats
path: root/generate-stackbrew-library.sh
diff options
context:
space:
mode:
authorJ0WI <J0WI@users.noreply.github.com>2018-02-14 01:19:07 +0100
committerJ0WI <J0WI@users.noreply.github.com>2018-02-22 18:07:57 +0100
commit8281ad1663a0d65c4757615a137c408367531eb8 (patch)
tree2adfe567edcc1110372807ceaf09261213ae8669 /generate-stackbrew-library.sh
parentbf2dc98496be77bf83c277219356fa807a4af7bc (diff)
Fix list of architectures for Apline
Diffstat (limited to 'generate-stackbrew-library.sh')
-rwxr-xr-xgenerate-stackbrew-library.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index da3fd6c0..453473ea 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -25,6 +25,22 @@ dockerfileCommit() {
)
}
+getArches() {
+ local repo="$1"; shift
+ local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/'
+
+ eval "declare -g -A parentRepoToArches=( $(
+ find -name 'Dockerfile' -exec awk '
+ toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ {
+ print "'"$officialImagesUrl"'" $2
+ }
+ ' '{}' + \
+ | sort -u \
+ | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
+ ) )"
+}
+getArches 'nextcloud'
+
# Header.
cat <<-EOH
# This file is generated via https://github.com/nextcloud/docker/blob/$(fileCommit "$self")/$self
@@ -70,10 +86,13 @@ for version in "${versions[@]}"; do
variantAliases+=( "${versionAliases[@]}" )
fi
+ variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$version/$variant/Dockerfile")"
+ variantArches="${parentRepoToArches[$variantParent]}"
+
cat <<-EOE
Tags: $(join ', ' "${variantAliases[@]}")
- Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, s390x
+ Architectures: $(join ', ' $variantArches)
GitCommit: $commit
Directory: $version/$variant
EOE