2021-11-23 23:40:27 +00:00
|
|
|
# Docker Buildx Bake build definition file
|
|
|
|
# Reference: https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md
|
|
|
|
|
2022-03-14 05:53:03 +00:00
|
|
|
variable "REGISTRY_USER" {
|
|
|
|
default = "frappe"
|
|
|
|
}
|
|
|
|
|
2023-06-26 06:24:37 +00:00
|
|
|
variable PYTHON_VERSION {
|
2023-10-20 13:10:10 +00:00
|
|
|
default = "3.11.6"
|
2023-06-26 06:24:37 +00:00
|
|
|
}
|
|
|
|
variable NODE_VERSION {
|
2023-10-20 13:10:10 +00:00
|
|
|
default = "18.18.2"
|
2023-06-26 06:24:37 +00:00
|
|
|
}
|
|
|
|
|
2022-03-14 05:53:03 +00:00
|
|
|
variable "FRAPPE_VERSION" {
|
|
|
|
default = "develop"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "ERPNEXT_VERSION" {
|
|
|
|
default = "develop"
|
|
|
|
}
|
2021-11-23 23:40:27 +00:00
|
|
|
|
2022-04-11 05:00:16 +00:00
|
|
|
variable "FRAPPE_REPO" {
|
|
|
|
default = "https://github.com/frappe/frappe"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "ERPNEXT_REPO" {
|
|
|
|
default = "https://github.com/frappe/erpnext"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "BENCH_REPO" {
|
|
|
|
default = "https://github.com/frappe/bench"
|
|
|
|
}
|
|
|
|
|
2023-07-18 04:02:27 +00:00
|
|
|
variable "LATEST_BENCH_RELEASE" {
|
|
|
|
default = "latest"
|
|
|
|
}
|
|
|
|
|
2022-02-08 08:35:52 +00:00
|
|
|
# Bench image
|
2021-10-26 12:16:57 +00:00
|
|
|
|
2022-02-08 08:35:52 +00:00
|
|
|
target "bench" {
|
2022-04-11 05:00:16 +00:00
|
|
|
args = {
|
|
|
|
GIT_REPO = "${BENCH_REPO}"
|
|
|
|
}
|
2022-03-14 05:53:03 +00:00
|
|
|
context = "images/bench"
|
2022-02-08 08:35:52 +00:00
|
|
|
target = "bench"
|
2023-07-24 11:27:39 +00:00
|
|
|
tags = [
|
|
|
|
"frappe/bench:${LATEST_BENCH_RELEASE}",
|
|
|
|
"frappe/bench:latest",
|
|
|
|
]
|
2021-11-04 12:31:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
target "bench-test" {
|
2022-02-08 08:35:52 +00:00
|
|
|
inherits = ["bench"]
|
|
|
|
target = "bench-test"
|
2021-10-26 12:16:57 +00:00
|
|
|
}
|
|
|
|
|
2021-11-23 23:40:27 +00:00
|
|
|
# Main images
|
|
|
|
# Base for all other targets
|
|
|
|
|
2022-03-14 05:53:03 +00:00
|
|
|
group "default" {
|
2023-01-15 22:50:09 +00:00
|
|
|
targets = ["erpnext"]
|
2021-10-26 12:16:57 +00:00
|
|
|
}
|
|
|
|
|
2022-03-14 05:53:03 +00:00
|
|
|
function "tag" {
|
|
|
|
params = [repo, version]
|
|
|
|
result = [
|
|
|
|
# If `version` param is develop (development build) then use tag `latest`
|
|
|
|
"${version}" == "develop" ? "${REGISTRY_USER}/${repo}:latest" : "${REGISTRY_USER}/${repo}:${version}",
|
|
|
|
# Make short tag for major version if possible. For example, from v13.16.0 make v13.
|
|
|
|
can(regex("(v[0-9]+)[.]", "${version}")) ? "${REGISTRY_USER}/${repo}:${regex("(v[0-9]+)[.]", "${version}")[0]}" : "",
|
|
|
|
]
|
2021-11-04 12:31:49 +00:00
|
|
|
}
|
|
|
|
|
2022-03-14 05:53:03 +00:00
|
|
|
target "default-args" {
|
2021-11-23 23:40:27 +00:00
|
|
|
args = {
|
2023-01-15 22:50:09 +00:00
|
|
|
FRAPPE_PATH = "${FRAPPE_REPO}"
|
|
|
|
ERPNEXT_PATH = "${ERPNEXT_REPO}"
|
2022-04-11 05:00:16 +00:00
|
|
|
BENCH_REPO = "${BENCH_REPO}"
|
2023-01-15 22:50:09 +00:00
|
|
|
FRAPPE_BRANCH = "${FRAPPE_VERSION}"
|
|
|
|
ERPNEXT_BRANCH = "${ERPNEXT_VERSION}"
|
2023-06-26 06:24:37 +00:00
|
|
|
PYTHON_VERSION = "${PYTHON_VERSION}"
|
|
|
|
NODE_VERSION = "${NODE_VERSION}"
|
2021-11-23 23:40:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-15 22:50:09 +00:00
|
|
|
target "erpnext" {
|
2022-03-14 05:53:03 +00:00
|
|
|
inherits = ["default-args"]
|
2023-01-15 22:50:09 +00:00
|
|
|
context = "."
|
|
|
|
dockerfile = "images/production/Containerfile"
|
2022-03-14 05:53:03 +00:00
|
|
|
target = "erpnext"
|
2023-01-15 22:50:09 +00:00
|
|
|
tags = tag("erpnext", "${ERPNEXT_VERSION}")
|
2021-11-04 12:31:49 +00:00
|
|
|
}
|