Skip to content

Commit

Permalink
Merge pull request #273 from infosiftr/shared-tags
Browse files Browse the repository at this point in the history
Move "openjdk:X-jdk" tags to "SharedTags:" so that in 12+, they can be shared by Windows
  • Loading branch information
yosifkit authored Jan 23, 2019
2 parents 2ac692b + dc54a4e commit 8f70fb8
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,18 @@ _latest() {
local variant="$1"; shift

if [ "$javaVersion" -ge 12 ]; then
# version 12+ moves "latest" over to the Oracle-based builds
[ "$variant" = 'oracle' ]
# version 12+ moves "latest" over to the Oracle-based builds (and includes Windows!)
case "$variant" in
oracle | windowsservercore* ) return 0 ;;
esac
else
# for versions < 12, the non-variant variant (which is Debian) should be "latest"
[ -z "$variant" ]
if [ -z "$variant" ]; then
return 0
fi
fi

return 1
}

aliases() {
Expand Down Expand Up @@ -114,17 +120,17 @@ aliases() {
local variantAliases=()
local variant
for variant in "${variants[@]}"; do
if [ -n "$variant" ]; then
local thisVariantAliases=( "${versionAliases[@]/%/-$variant}" )
variantAliases+=( "${thisVariantAliases[@]//latest-/}" )
fi
if _latest "$javaVersion" "$variant"; then
variantAliases+=( "${versionAliases[@]}" )
fi
case "$variant" in
latest) variantAliases+=( "${versionAliases[@]}" ) ;;
'') ;;
*)
local thisVariantAliases=( "${versionAliases[@]/%/-$variant}" )
variantAliases+=( "${thisVariantAliases[@]//latest-/}" )
;;
esac
done
versionAliases=( "${variantAliases[@]}" )

echo "${versionAliases[@]}"
echo "${variantAliases[@]}"
}

for javaVersion in "${versions[@]}"; do
Expand Down Expand Up @@ -164,10 +170,13 @@ for javaVersion in "${versions[@]}"; do
sharedTags=()
for windowsShared in windowsservercore nanoserver; do
if [[ "$variant" == "$windowsShared"* ]]; then
sharedTags=( $(aliases "$javaVersion" "$javaType" "$fullVersion" "$windowsShared") )
sharedTags+=( $(aliases "$javaVersion" "$javaType" "$fullVersion" "$windowsShared") )
break
fi
done
if _latest "$javaVersion" "$variant"; then
sharedTags+=( $(aliases "$javaVersion" "$javaType" "$fullVersion" 'latest') )
fi

variantAliases=()
fromTag="$(git show "$commit":"$dir/Dockerfile" | awk -v variant="$variant" '
Expand Down

0 comments on commit 8f70fb8

Please sign in to comment.