Skip to content

Commit

Permalink
chore: do not push some tags
Browse files Browse the repository at this point in the history
if we are not building the latest maven version
  • Loading branch information
carlossg committed Dec 18, 2023
1 parent 3e9b22a commit 9df8666
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -eu

# Default values for 'latest' tag
latestMavenVersion='3.9.6'
latest='21'
default_jdk=eclipse-temurin

Expand Down Expand Up @@ -79,24 +80,29 @@ version-aliases() {
done

# tag full version
versionAliases+=("$mavenVersion-$version")
if [ "$mavenVersion" = "$latestMavenVersion" ]; then
versionAliases+=("$mavenVersion-$version") # 3-amazoncorretto-11
fi
for extraSuffix in "${extraSuffixes[@]}"; do
versionAliases+=("${mavenVersion}-${version}-${extraSuffix}")
done

# tag 3, latest
if [[ "$version" == "$default_jdk-$latest" ]]; then
versionAliases+=("$mavenVersion" latest)
[ "$branch" = 'main' ] || versionAliases+=("$branch")
fi

for parent_image in "${parent_images[@]}"; do
local parent_image_latest="${jdk_latest[$parent_image]}"
if [[ "$version" == "$parent_image-${parent_image_latest}" ]]; then
# tag 3-ibmjava ibmjava 3-amazoncorretto amazoncorretto
versionAliases+=("$mavenVersion-${version//-$parent_image_latest/}" "${version//-$parent_image_latest/}")
# do not tag 3, latest, 3-amazoncorretto, amazoncorretto,... if we are not building the latest version
if [ "$mavenVersion" = "$latestMavenVersion" ]; then
# tag 3, latest
if [[ "$version" == "$default_jdk-$latest" ]]; then
versionAliases+=("$mavenVersion" latest)
[ "$branch" = 'main' ] || versionAliases+=("$branch")
fi
done

for parent_image in "${parent_images[@]}"; do
local parent_image_latest="${jdk_latest[$parent_image]}"
if [[ "$version" == "$parent_image-${parent_image_latest}" ]]; then
# tag 3-ibmjava ibmjava 3-amazoncorretto amazoncorretto
versionAliases+=("$mavenVersion-${version//-$parent_image_latest/}" "${version//-$parent_image_latest/}")
fi
done
fi

# extra tags for variants
if [ -n "${extra_tags[$version]:-}" ]; then
Expand Down

0 comments on commit 9df8666

Please sign in to comment.