From 05a198ca89a5cb563a857d0d6f060abcbd6eb8e4 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 3 Aug 2017 14:07:41 -0700 Subject: [PATCH] Adjust "slim" variants to also include hyper-explicit aliases ("slim-jessie", etc) --- generate-stackbrew-library.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index b7265a3e9..6e4d15879 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -91,6 +91,12 @@ for version in "${versions[@]}"; do dir="$version/$v" variant="$(basename "$v")" + if [ "$variant" = 'slim' ]; then + # convert "slim" into "slim-jessie" + # https://github.com/docker-library/ruby/pull/142#issuecomment-320012893 + variant="$variant-$(basename "$(dirname "$v")")" + fi + [ -f "$dir/Dockerfile" ] || continue commit="$(dirCommit "$dir")" @@ -108,11 +114,17 @@ for version in "${versions[@]}"; do ) variantAliases=( "${versionAliases[@]/%/-$variant}" ) - if [ "$variant" = "$debianSuite" ]; then - variantAliases+=( "${versionAliases[@]}" ) - elif [ "$variant" = "alpine${alpineVersion}" ]; then - variantAliases+=( "${versionAliases[@]/%/-alpine}" ) - fi + case "$variant" in + "$debianSuite") + variantAliases+=( "${versionAliases[@]}" ) + ;; + *-"$debianSuite") + variantAliases+=( "${versionAliases[@]/%/-${variant%-$debianSuite}}" ) + ;; + "alpine${alpineVersion}") + variantAliases+=( "${versionAliases[@]/%/-alpine}" ) + ;; + esac variantAliases=( "${variantAliases[@]//latest-/}" ) case "$v" in