Skip to content
Snippets Groups Projects
Commit a37e9296 authored by Tianon Gravi's avatar Tianon Gravi
Browse files

Update `generate-stackbrew-library.sh` to support `BASHBREW_LIBRARY` for easier cascading updates

parent b4063805
Branches
No related tags found
No related merge requests found
......@@ -44,17 +44,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 'postgres'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment