2021-09-25 03:19:05 +02:00
|
|
|
group "default" {
|
2023-04-09 21:58:01 +02:00
|
|
|
targets = [
|
|
|
|
"5_9_0",
|
|
|
|
"5_9_1",
|
|
|
|
"5_9_2",
|
|
|
|
"5_9_3",
|
|
|
|
"6_0_0",
|
|
|
|
"6_0_1",
|
|
|
|
"6_0_2",
|
|
|
|
"6_0_3",
|
|
|
|
"6_1_0",
|
|
|
|
"6_1_1",
|
2023-05-22 23:19:23 +02:00
|
|
|
"6_2_0",
|
2023-08-06 22:03:56 +02:00
|
|
|
"6_2_1",
|
2023-09-22 21:04:01 +02:00
|
|
|
"6_2_2",
|
|
|
|
"6_3_0"
|
2023-04-09 21:58:01 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "build-dockerfile" {
|
|
|
|
dockerfile = "Dockerfile"
|
|
|
|
}
|
|
|
|
|
|
|
|
target "build-platforms" {
|
2023-08-06 22:10:28 +02:00
|
|
|
platforms = ["linux/amd64", "linux/aarch64"]
|
2023-04-09 21:58:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
target "build-common" {
|
|
|
|
pull = true
|
2021-09-25 03:19:05 +02:00
|
|
|
}
|
|
|
|
|
2023-04-09 21:46:50 +02:00
|
|
|
variable "REGISTRY_CACHE" {
|
|
|
|
default = "docker.io/nlss/wordpress-cache"
|
|
|
|
}
|
|
|
|
|
2023-04-09 21:58:01 +02:00
|
|
|
######################
|
|
|
|
# Define the functions
|
|
|
|
######################
|
|
|
|
|
2023-04-08 19:39:44 +02:00
|
|
|
# Get the arguments for the build
|
|
|
|
function "get-args" {
|
2023-08-06 22:25:41 +02:00
|
|
|
params = [version, patch_version]
|
2023-04-08 19:39:44 +02:00
|
|
|
result = {
|
|
|
|
WP_VERSION = version
|
2023-08-06 22:26:46 +02:00
|
|
|
WP_PATCH_VERSION = patch_version
|
2023-04-08 19:39:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Get the cache-from configuration
|
|
|
|
function "get-cache-from" {
|
|
|
|
params = [version]
|
|
|
|
result = [
|
2023-04-09 21:46:50 +02:00
|
|
|
"type=registry,ref=${REGISTRY_CACHE}:${sha1("${version}-${BAKE_LOCAL_PLATFORM}")}"
|
2023-04-08 19:39:44 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Get the cache-to configuration
|
|
|
|
function "get-cache-to" {
|
|
|
|
params = [version]
|
|
|
|
result = [
|
2023-04-11 12:59:28 +02:00
|
|
|
"type=registry,mode=max,ref=${REGISTRY_CACHE}:${sha1("${version}-${BAKE_LOCAL_PLATFORM}")}"
|
2023-04-08 19:39:44 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Get list of image tags and registries
|
|
|
|
# Takes a version and a list of extra versions to tag
|
|
|
|
# eg. get-tags("5.9.0", ["5", "5.9", "latest"])
|
|
|
|
function "get-tags" {
|
|
|
|
params = [version, extra_versions]
|
|
|
|
result = concat(
|
|
|
|
[
|
|
|
|
"docker.io/nlss/wordpress:${version}",
|
|
|
|
"ghcr.io/n0rthernl1ghts/wordpress:${version}"
|
|
|
|
],
|
|
|
|
flatten([
|
|
|
|
for extra_version in extra_versions : [
|
|
|
|
"docker.io/nlss/wordpress:${extra_version}",
|
|
|
|
"ghcr.io/n0rthernl1ghts/wordpress:${extra_version}"
|
|
|
|
]
|
|
|
|
])
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2023-04-09 21:58:01 +02:00
|
|
|
##########################
|
|
|
|
# Define the build targets
|
|
|
|
##########################
|
2021-09-25 03:19:05 +02:00
|
|
|
|
2022-05-25 19:55:09 +02:00
|
|
|
target "5_9_0" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("5.9.0")
|
|
|
|
cache-to = get-cache-to("5.9.0")
|
|
|
|
tags = get-tags("5.9.0", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("5.9.0", "5.9.0")
|
2022-02-03 19:50:56 +01:00
|
|
|
}
|
2022-03-22 19:19:48 +01:00
|
|
|
|
2022-05-25 19:55:09 +02:00
|
|
|
target "5_9_1" {
|
2023-04-06 21:32:28 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
2023-04-08 19:39:44 +02:00
|
|
|
cache-from = get-cache-from("5.9.1")
|
|
|
|
cache-to = get-cache-to("5.9.1")
|
|
|
|
tags = get-tags("5.9.1", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("5.9.1", "5.9.1")
|
2022-03-22 19:25:03 +01:00
|
|
|
}
|
|
|
|
|
2022-05-25 19:55:09 +02:00
|
|
|
target "5_9_2" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("5.9.2")
|
|
|
|
cache-to = get-cache-to("5.9.2")
|
|
|
|
tags = get-tags("5.9.2", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("5.9.2", "5.9.1")
|
2022-05-25 19:21:09 +02:00
|
|
|
}
|
|
|
|
|
2022-05-25 19:55:09 +02:00
|
|
|
target "5_9_3" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("5.9.3")
|
|
|
|
cache-to = get-cache-to("5.9.3")
|
|
|
|
tags = get-tags("5.9.3", ["5", "5.9"])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("5.9.3", "5.9.1")
|
2022-07-25 23:38:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
target "6_0_0" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.0.0")
|
|
|
|
cache-to = get-cache-to("6.0.0")
|
|
|
|
tags = get-tags("6.0.0", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.0.0", "5.9.1")
|
2022-07-25 23:42:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
target "6_0_1" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.0.1")
|
|
|
|
cache-to = get-cache-to("6.0.1")
|
|
|
|
tags = get-tags("6.0.1", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.0.1", "5.9.1")
|
2022-09-10 03:39:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
target "6_0_2" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.0.2")
|
|
|
|
cache-to = get-cache-to("6.0.2")
|
|
|
|
tags = get-tags("6.0.2", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.0.2", "5.9.1")
|
2022-11-02 21:33:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
target "6_0_3" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.0.3")
|
|
|
|
cache-to = get-cache-to("6.0.3")
|
|
|
|
tags = get-tags("6.0.3", ["6.0"])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.0.3", "5.9.1")
|
2022-11-02 21:37:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
target "6_1_0" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.1.0")
|
|
|
|
cache-to = get-cache-to("6.1.0")
|
|
|
|
tags = get-tags("6.1.0", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.1.0", "5.9.1")
|
2023-01-19 23:48:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
target "6_1_1" {
|
2023-04-06 21:32:28 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
2023-04-08 19:39:44 +02:00
|
|
|
cache-from = get-cache-from("6.1.1")
|
|
|
|
cache-to = get-cache-to("6.1.1")
|
2023-04-08 19:46:25 +02:00
|
|
|
tags = get-tags("6.1.1", ["6.1"])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.1.1", "5.9.1")
|
2023-04-02 20:32:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
target "6_2_0" {
|
2023-04-08 19:39:44 +02:00
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.2.0")
|
|
|
|
cache-to = get-cache-to("6.2.0")
|
2023-05-22 23:19:23 +02:00
|
|
|
tags = get-tags("6.2.0", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.2.0", "5.9.1")
|
2023-05-03 00:46:44 +02:00
|
|
|
}
|
2023-05-22 23:19:23 +02:00
|
|
|
|
|
|
|
target "6_2_1" {
|
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.2.1")
|
|
|
|
cache-to = get-cache-to("6.2.1")
|
2023-08-06 22:03:56 +02:00
|
|
|
tags = get-tags("6.2.1", [])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.2.1", "5.9.1")
|
2023-05-22 23:19:23 +02:00
|
|
|
}
|
2023-08-06 22:03:56 +02:00
|
|
|
|
|
|
|
target "6_2_2" {
|
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.2.2")
|
|
|
|
cache-to = get-cache-to("6.2.2")
|
2023-09-22 21:04:01 +02:00
|
|
|
tags = get-tags("6.2.2", ["6.2"])
|
2023-08-06 22:25:41 +02:00
|
|
|
args = get-args("6.2.2", "5.9.1")
|
2023-08-06 22:03:56 +02:00
|
|
|
}
|
2023-09-22 21:04:01 +02:00
|
|
|
|
|
|
|
target "6_3_0" {
|
|
|
|
inherits = ["build-dockerfile", "build-platforms", "build-common"]
|
|
|
|
cache-from = get-cache-from("6.3.0")
|
|
|
|
cache-to = get-cache-to("6.3.0")
|
|
|
|
tags = get-tags("6.3.0", ["6", "6.3", "latest"])
|
|
|
|
args = get-args("6.3.0", "6.3.0")
|
|
|
|
}
|