Skip to content

Commit

Permalink
chore: define jdks to build at a single place in docker bake
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Jun 23, 2024
1 parent 3c4d2b1 commit 974969e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ group "linux-ppc64le" {
]
}

variable "jdks_to_build" {
default = [11, 17, 21]
}

variable "default_jdk" {
default = 17
}

variable "REMOTING_VERSION" {
default = "3256.v88a_f6e922152"
}
Expand Down Expand Up @@ -113,10 +121,6 @@ function "orgrepo" {
result = equal("agent", agentType) ? "${REGISTRY_ORG}/${REGISTRY_REPO_AGENT}" : "${REGISTRY_ORG}/${REGISTRY_REPO_INBOUND_AGENT}"
}

variable "default_jdk" {
default = 17
}

# Return "true" if the jdk passed as parameter is the same as the default jdk, "false" otherwise
function "is_default_jdk" {
params = [jdk]
Expand Down Expand Up @@ -154,7 +158,7 @@ function "debian_platforms" {
target "alpine" {
matrix = {
type = ["agent", "inbound-agent"]
jdk = [11, 17, 21]
jdk = jdks_to_build
}
name = "${type}_alpine_jdk${jdk}"
target = type
Expand Down Expand Up @@ -188,9 +192,9 @@ target "alpine" {
target "debian" {
matrix = {
type = ["agent", "inbound-agent"]
jdk = [11, 17, 21]
jdk = jdks_to_build
}
name = "${type}_debian_${jdk}"
name = "${type}_debian_jdk${jdk}"
target = type
dockerfile = "debian/Dockerfile"
context = "."
Expand Down

0 comments on commit 974969e

Please sign in to comment.