Skip to content

Commit bebe68a

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 3056c11 commit bebe68a

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
@@ -35,17 +35,19 @@ dirCommit() {
3535

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

40-
eval "declare -g -A parentRepoToArches=( $(
41-
find -name 'Dockerfile' -exec awk '
40+
local parentRepoToArchesStr
41+
parentRepoToArchesStr="$(
42+
find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" '
4243
toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ {
43-
print "'"$officialImagesUrl"'" $2
44+
printf "%s%s\n", officialImagesBase, $2
4445
}
4546
' '{}' + \
4647
| sort -u \
47-
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
48-
) )"
48+
| xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"'
49+
)"
50+
eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )"
4951
}
5052
getArches 'httpd'
5153

0 commit comments

Comments
 (0)