From 18220a20654cddb148eb6b0097237a0299a2e253 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 11 Aug 2015 15:12:43 -0700 Subject: [PATCH] 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 --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 1231e2a687..109ccb86c3 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -15,7 +15,7 @@ url='git://github.com/docker-library/postgres' echo '# maintainer: InfoSiftr (@infosiftr)' for version in "${versions[@]}"; do - commit="$(git log -1 --format='format:%H' -- "$version")" + commit="$(cd "$version" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))" fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')" versionAliases=( $fullVersion $version ${aliases[$version]} )