Skip to content

Commit 6016bb3

Browse files
committed
Update generate-stackbrew-library.sh to support BASHBREW_LIBRARY for easier cascading updates
See docker-library/official-images#17640 (comment)
1 parent c632cbc commit 6016bb3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

generate-stackbrew-library.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,19 @@ dirCommit() {
4949

5050
getArches() {
5151
local repo="$1"; shift
52-
local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/'
52+
local officialImagesBase="${BASHBREW_LIBRARY:-https://github.com/docker-library/official-images/raw/HEAD/library}/"
5353

54-
eval "declare -g -A parentRepoToArches=( $(
55-
find -name Dockerfile -exec awk '
54+
local parentRepoToArchesStr
55+
parentRepoToArchesStr="$(
56+
find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" '
5657
/^FROM/ {
5758
if (index($2, ":") > 0 && index($2, "'"$repo"'") == 0) {
58-
print "'"$officialImagesUrl"'" $2
59+
printf "%s%s\n", officialImagesBase, $2
5960
}
6061
}' '{}' + | sort -u \
61-
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
62-
) )"
62+
| xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"'
63+
)"
64+
eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )"
6365
}
6466
getArches 'rabbitmq'
6567

0 commit comments

Comments
 (0)