Skip to content

Commit b9f220c

Browse files
fix: add mutable floating tag for Java variant release builds (#34745) (#34766)
## Summary Fixes #34745 When `raw_suffix` is non-empty (e.g., `java-25`), push a suffix-only mutable tag to Docker Hub for both `dotcms/dotcms` and `dotcms/dotcms-dev`. This provides the variant equivalent of `latest` for primary builds. ## Changes - Add `extra-tags` to deploy-docker when `raw_suffix` is non-empty (unconditional, no `latest` gate) - Add `artifact_suffix` to dev image deploy-docker call (was missing) - Update tag model documentation with variant release floating tag - Apply `java-25` naming convention (dash separator) per team decision ## Acceptance Criteria - [x] When a Java variant release completes, a mutable tag matching the raw artifact suffix is pushed for both images - [x] The suffix-based floating tag is pushed unconditionally whenever `raw_suffix` is non-empty - [x] Existing tags (`{version}_{suffix}`, `{version}_{suffix}_{sha}`) continue to be created - [x] The `latest` tag for primary releases is unaffected - [x] `cicd_7-release-java-variant.yml` does not need `latest: true` - [x] Tag model documentation updated Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8ea3d7e commit b9f220c

3 files changed

Lines changed: 26 additions & 19 deletions

File tree

.github/actions/core-cicd/deployment/deploy-docker/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ inputs:
5959
required: false
6060
default: ''
6161
artifact_suffix:
62-
description: 'Suffix for artifact names (e.g., -java25). Used to download the correct docker-build-context artifact.'
62+
description: 'Suffix for artifact names (e.g., -java-25). Used to download the correct docker-build-context artifact.'
6363
required: false
6464
default: ''
6565
pull:
6666
description: 'Pull image before building'
6767
required: false
6868
default: 'false'
6969
identifier-tag:
70-
description: 'Optional mutable alias tag managed by the deployment phase (e.g., nightly_20250218_java25, manual_issue-123_java25). Applied when non-empty.'
70+
description: 'Optional mutable alias tag managed by the deployment phase (e.g., nightly_20250218_java-25, manual_issue-123_java-25). Applied when non-empty.'
7171
required: false
7272
default: ''
7373
custom-tag:
74-
description: 'Optional custom alias tag chosen by the developer (e.g., modernization, java25-testing). Applied when non-empty.'
74+
description: 'Optional custom alias tag chosen by the developer (e.g., modernization, java-25-testing). Applied when non-empty.'
7575
required: false
7676
default: ''
7777
extra-tags:

.github/workflows/cicd_7-release-java-variant.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# This variant workflow:
1414
# - Uses alternate Java version for compilation (e.g., Java 25 vs Java 21)
1515
# - Overrides -Dchangelist at runtime to create different Maven version
16-
# (e.g., 25.02.16-01-java25 vs 25.02.16-01)
16+
# (e.g., 25.02.16-01-java-25 vs 25.02.16-01)
1717
# - Adds artifact suffix to distinguish build artifacts and Docker tags
1818
# - Skips operations already performed by primary (javadocs, plugins, labels)
1919
#
@@ -24,7 +24,7 @@
2424
# Configuration:
2525
# Set repository variables for automatic parallel builds:
2626
# RELEASE_JAVA_VARIANT_VERSION: Java version in SDKMAN format (e.g., 25.0.2-ms)
27-
# RELEASE_JAVA_VARIANT_SUFFIX: Artifact suffix without separator (e.g., java25-ms)
27+
# RELEASE_JAVA_VARIANT_SUFFIX: Artifact suffix without separator (e.g., java-25-ms)
2828
#
2929

3030
name: '-7 Release Java Variant'
@@ -46,7 +46,7 @@ on:
4646
type: string
4747
default: ''
4848
artifact_suffix:
49-
description: 'Artifact suffix without leading separator (e.g., java25, java25-ms). Separators added automatically: dash (-) for Maven artifacts, underscore (_) for Docker tags. If not set, derived from java-version major (e.g., java25).'
49+
description: 'Artifact suffix without leading separator (e.g., java-25, java-25-ms). Separators added automatically: dash (-) for Maven artifacts, underscore (_) for Docker tags. If not set, derived from java-version major (e.g., java-25).'
5050
required: false
5151
type: string
5252
default: ''

.github/workflows/cicd_comp_deployment-phase.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@
2727
# ONLY when latest=true; never set by nightly/trunk/feature/manual.
2828
# Applies to both main (dotcms) and dev (dotcms-dev) images.
2929
#
30+
# release (Java variant): Same as release, plus:
31+
# {suffix} ← mutable floating tag (e.g. java-25), variant equivalent of latest.
32+
# Pushed unconditionally when raw_suffix is non-empty; not gated on latest.
33+
#
3034
# manual: manual ← mutable, always latest manual build
3135
# manual_{sha} ← immutable
3236
# manual_{ref} ← mutable alias (tag-identifier = sanitized ref branch)
3337
# {custom-tag} ← optional exact alias chosen by the developer
3438
#
35-
# Java variant suffix (_java25 etc.) is part of the base tag; in identifier aliases
36-
# the identifier comes first (matching the release pattern 25.02.16-01_java25):
37-
# nightly_java25, nightly_java25_{sha}, nightly_{date}_java25
38-
# manual_java25, manual_java25_{sha}, manual_{ref}_java25
39+
# Java variant suffix (_java-25 etc.) is part of the base tag; in identifier aliases
40+
# the identifier comes first (matching the release pattern 25.02.16-01_java-25):
41+
# nightly_java-25, nightly_java-25_{sha}, nightly_{date}_java-25
42+
# manual_java-25, manual_java-25_{sha}, manual_{ref}_java-25
3943
#
4044
# All tags (base, sha, identifier alias, custom) are applied in a single docker build.
4145
# The deploy-docker action accepts semantic inputs (identifier-tag, custom-tag); the
@@ -69,7 +73,7 @@ on:
6973
type: boolean
7074
default: false
7175
custom-tag:
72-
description: 'Optional exact alias tag, used by manual workflow for developer-chosen tag names (e.g., modernization, java25-testing). Pulled from the immutable SHA tag for reliability.'
76+
description: 'Optional exact alias tag, used by manual workflow for developer-chosen tag names (e.g., modernization, java-25-testing). Pulled from the immutable SHA tag for reliability.'
7377
required: false
7478
type: string
7579
default: ''
@@ -97,7 +101,7 @@ on:
97101
type: string
98102
default: ''
99103
artifact-suffix:
100-
description: 'Artifact suffix without leading separator (e.g., java25, java25-ms). Separators added automatically: dash (-) for Maven artifacts, underscore (_) for Docker tags. If not set, derived from java-version major (e.g., java25).'
104+
description: 'Artifact suffix without leading separator (e.g., java-25, java-25-ms). Separators added automatically: dash (-) for Maven artifacts, underscore (_) for Docker tags. If not set, derived from java-version major (e.g., java-25).'
101105
required: false
102106
type: string
103107
default: ''
@@ -151,13 +155,13 @@ jobs:
151155
shell: bash
152156
run: |
153157
# Naming Convention for Java Variants:
154-
# - User input: suffix without leading separator (e.g., "java25" or "java25-ms")
155-
# - Maven artifacts: use dash separator (e.g., "-java25")
156-
# - Docker tags: use underscore separator (e.g., "_java25")
158+
# - User input: suffix without leading separator (e.g., "java-25" or "java-25-ms")
159+
# - Maven artifacts: use dash separator (e.g., "-java-25")
160+
# - Docker tags: use underscore separator (e.g., "_java-25")
157161
#
158162
# Note: Underscore in Docker tags is non-standard but follows existing dotCMS convention.
159163
# Docker typically uses dash or no separator, but we use underscore to distinguish from
160-
# version dashes (e.g., "25.02.16-01_java25_abc123" vs "25.02.16-01-java25-abc123").
164+
# version dashes (e.g., "25.02.16-01_java-25_abc123" vs "25.02.16-01-java-25-abc123").
161165
# This convention may be revisited in future.
162166
163167
# Use provided java-version if set, otherwise read from .sdkmanrc
@@ -172,7 +176,7 @@ jobs:
172176
echo "Using explicit artifact suffix: ${RAW_SUFFIX}"
173177
else
174178
JAVA_MAJOR=$(echo "${{ inputs.java-version }}" | grep -oE '^[0-9]+')
175-
RAW_SUFFIX="java${JAVA_MAJOR}"
179+
RAW_SUFFIX="java-${JAVA_MAJOR}"
176180
echo "Using derived artifact suffix: ${RAW_SUFFIX}"
177181
fi
178182
@@ -215,10 +219,10 @@ jobs:
215219
# Compute Docker tags for this build.
216220
#
217221
# base_tag: primary mutable tag — {identifier|environment}{suffix}
218-
# e.g. nightly_java25, 25.02.16-01_java25, manual_java25
222+
# e.g. nightly_java-25, 25.02.16-01_java-25, manual_java-25
219223
#
220224
# identifier_tag: mutable alias — {environment}_{identifier}{suffix}
221-
# e.g. nightly_20250218_java25, manual_issue-123_java25
225+
# e.g. nightly_20250218_java-25, manual_issue-123_java-25
222226
# Empty (disabled) when:
223227
# - no tag-identifier (trunk has none)
224228
# - omit-environment-prefix=true (release: identifier IS the primary tag)
@@ -261,6 +265,7 @@ jobs:
261265
SDKMAN_JAVA_VERSION=${{ steps.get-sdkman-version.outputs.SDKMAN_JAVA_VERSION }}
262266
identifier-tag: ${{ steps.docker-tags.outputs.identifier_tag }}
263267
custom-tag: ${{ inputs.custom-tag }}
268+
extra-tags: ${{ steps.get-sdkman-version.outputs.raw_suffix != '' && format('type=raw,value={0},enable=true', steps.get-sdkman-version.outputs.raw_suffix) || '' }}
264269

265270
# Format tags for Slack notifications
266271
- name: Format Tags
@@ -301,7 +306,9 @@ jobs:
301306
DOTCMS_DOCKER_TAG=${{ steps.docker-tags.outputs.base_tag }}
302307
DEV_REQUEST_TOKEN=${{ secrets.DEV_REQUEST_TOKEN }}
303308
SDKMAN_JAVA_VERSION=${{ steps.get-sdkman-version.outputs.SDKMAN_JAVA_VERSION }}
309+
artifact_suffix: ${{ steps.get-sdkman-version.outputs.maven_suffix }}
304310
identifier-tag: ${{ steps.docker-tags.outputs.identifier_tag }}
311+
extra-tags: ${{ steps.get-sdkman-version.outputs.raw_suffix != '' && format('type=raw,value={0},enable=true', steps.get-sdkman-version.outputs.raw_suffix) || '' }}
305312

306313
# Deploy CLI artifacts to JFrog Artifactory
307314
# Skipped when java-version is overridden (CLI not built due to GraalVM/Quarkus compatibility)

0 commit comments

Comments
 (0)