Skip to content

Commit

Permalink
Update generate-stackbrew-library.sh to support BASHBREW_LIBRARY
Browse files Browse the repository at this point in the history
…for easier cascading updates

See docker-library/official-images#17640 (comment)
  • Loading branch information
tianon committed Sep 30, 2024
1 parent 9c4cfca commit 75187df
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ dirCommit() {

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

eval "declare -g -A parentRepoToArches=( $(
find -name 'Dockerfile' -exec awk '
local parentRepoToArchesStr
parentRepoToArchesStr="$(
find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" '
toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ {
print "'"$officialImagesUrl"'" $2
printf "%s%s\n", officialImagesBase, $2
}
' '{}' + \
| sort -u \
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
) )"
| xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"'
)"
eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )"
}
getArches 'cassandra'

Expand Down

0 comments on commit 75187df

Please sign in to comment.