From feb527c881ab12fd6e42949ddd080a0afeda4714 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 30 Sep 2024 11:28:39 -0700 Subject: [PATCH] Update `generate-stackbrew-library.sh` to support `BASHBREW_LIBRARY` for easier cascading updates See https://github.com/docker-library/official-images/pull/17640#issuecomment-2380308790 --- generate-stackbrew-library.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 164ac2de..38057f28 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -77,14 +77,15 @@ gawkParents=' getArches() { local repo="$1"; shift + local officialImagesBase="${BASHBREW_LIBRARY:-https://github.com/docker-library/official-images/raw/HEAD/library}/" local parentRepoToArchesStr parentRepoToArchesStr="$( find -name 'Dockerfile' -exec gawk "$gawkParents" '{}' + \ | sort -u \ - | gawk -v officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' ' + | gawk -v officialImagesBase="$officialImagesBase" ' $1 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ { - printf "%s%s\n", officialImagesUrl, $1 + printf "%s%s\n", officialImagesBase, $1 } ' \ | xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"'