Fix list of architectures for Apline

This commit is contained in:
J0WI 2018-02-14 01:19:07 +01:00
parent bf2dc98496
commit 8281ad1663
2 changed files with 23 additions and 3 deletions

View File

@ -43,7 +43,8 @@ jobs:
- <<: *test-scripts
env: SCRIPT=generate-stackbrew-library.sh
script:
- ./generate-stackbrew-library.sh
# Only syntax check due bashbrew dependency
- bash -n generate-stackbrew-library.sh
- stage: test images
env: VERSION=11.0 VARIANT=fpm-alpine ARCH=amd64

View File

@ -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