Skip to content

Commit 18220a2

Browse files
committed
Enhance "generate-stackbrew-library.sh" to only take into account changes to the Dockerfile or files from COPY in the Dockerfile for choosing the commit hash for a particular directory
1 parent 7fed429 commit 18220a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

generate-stackbrew-library.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ url='git://github.com/docker-library/postgres'
1515
echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
1616

1717
for version in "${versions[@]}"; do
18-
commit="$(git log -1 --format='format:%H' -- "$version")"
18+
commit="$(cd "$version" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
1919
fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')"
2020
versionAliases=( $fullVersion $version ${aliases[$version]} )
2121

0 commit comments

Comments
 (0)