Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ stage('Build') {
}

if (!infra.isTrusted()) {
// This list can be updated with the following command:
// make show | jq -r '.target | keys[]' | sort
def images = [

This comment was marked as resolved.

Copy link
Member Author

@lemeurherve lemeurherve Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: to be really strict, there should be a map for Weekly images, and another with LTS images to get a proper exhaustive simulated LTS build on ci.jenkins.io in all cases.

But since that diff (no simulated jdk17 LTS) would only occur when manually replaying a simulated build and while weekly and LTS don't have the same list of JDKs, I didn't bother.

Copy link
Member Author

@lemeurherve lemeurherve Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new comment could also be extracted in another PR if needed as not directly related to this feature.

'alpine_jdk17',
'alpine_jdk21',
Expand Down
32 changes: 24 additions & 8 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Variables
variable "jdks_to_build" {
variable "jdks_to_build_for_lts" {
default = [17, 21, 25]
}

variable "jdks_to_build_for_weekly" {
default = [17, 21, 25]
}

Expand Down Expand Up @@ -99,7 +103,7 @@ variable "current_rhel" {
## Targets
target "alpine" {
matrix = {
jdk = jdks_to_build
jdk = jdks_to_build()
}
name = "alpine_jdk${jdk}"
dockerfile = "alpine/hotspot/Dockerfile"
Expand All @@ -119,7 +123,7 @@ target "alpine" {

target "debian" {
matrix = {
jdk = jdks_to_build
jdk = jdks_to_build()
variant = debian_variants
}
name = "${variant}_jdk${jdk}"
Expand All @@ -142,7 +146,7 @@ target "debian" {

target "rhel" {
matrix = {
jdk = jdks_to_build
jdk = jdks_to_build()
}
name = "rhel_jdk${jdk}"
dockerfile = "rhel/Dockerfile"
Expand Down Expand Up @@ -171,6 +175,21 @@ group "linux" {
}

## Common functions
# return true if JENKINS_VERSION is a Weekly (one sequence of digits with a trailing literal '.')
function "is_jenkins_version_weekly" {
# If JENKINS_VERSION has more than one sequence of digits with a trailing literal '.', this is LTS
# 2.523 has only one sequence of digits with a trailing literal '.'
# 2.516.1 has two sequences of digits with a trailing literal '.'
params = []
result = length(regexall("[0-9]+[.]", JENKINS_VERSION)) < 2 ? true : false
}

# return the list of jdk to build depending on JENKINS_VERSION
function "jdks_to_build" {
params = []
result = is_jenkins_version_weekly() ? jdks_to_build_for_weekly : jdks_to_build_for_lts
}

# return a tag prefixed by the Jenkins version
function "_tag_jenkins_version" {
params = [tag]
Expand All @@ -197,13 +216,10 @@ function "tag_lts" {

# return WAR_URL if not empty, get.jenkins.io URL depending on JENKINS_VERSION release line otherwise
function "war_url" {
# If JENKINS_VERSION has more than one sequence of digits with a trailing literal '.', this is LTS
# 2.523 has only one sequence of digits with a trailing literal '.'
# 2.516.1 has two sequences of digits with a trailing literal '.'
params = []
result = (notequal(WAR_URL, "")
? WAR_URL
: (length(regexall("[0-9]+[.]", JENKINS_VERSION)) < 2
: (is_jenkins_version_weekly()
? "https://get.jenkins.io/war/${JENKINS_VERSION}/jenkins.war"
: "https://get.jenkins.io/war-stable/${JENKINS_VERSION}/jenkins.war"))
}
Expand Down