zitadel/docker-bake.hcl

136 lines
3.5 KiB
HCL
Raw Normal View History

2025-02-18 17:40:41 +01:00
variable "GITHUB_SHA" {
default = "latest"
}
variable "REGISTRY" {
2025-02-19 01:02:12 +01:00
default = "ghcr.io/zitadel"
2025-02-18 22:43:02 +01:00
}
2025-02-19 17:21:38 +01:00
group "all" {
targets = ["build", "output", "lint", "image", "unit"]
}
2025-02-18 22:43:02 +01:00
group "build" {
targets = ["console-build", "core-build"]
}
2025-02-24 21:04:49 +01:00
group "generate" {
targets = ["console-generate" , "core-generate"]
}
2025-02-18 22:43:02 +01:00
group "output" {
targets = ["console-output", "core-output"]
2025-02-18 17:40:41 +01:00
}
2025-02-19 10:12:00 +01:00
group "lint" {
targets = ["console-lint", "core-lint"]
}
2025-02-19 01:02:12 +01:00
group "image" {
targets = ["console-image", "core-image"]
}
2025-02-19 17:21:38 +01:00
group "unit" {
targets = ["core-unit"]
}
2025-02-19 01:02:12 +01:00
target "_console" {
dockerfile = "Dockerfile.console"
context = "."
contexts = {
node = "docker-image://node:22"
nginx = "docker-image://nginx:1.27-alpine"
}
}
target "console" {
name = "console-${tgt}"
inherits = ["_console"]
matrix = {
2025-02-24 21:04:49 +01:00
tgt = ["build", "output", "lint", "image", "generate"]
2025-02-19 01:02:12 +01:00
}
output = {
"build" = ["type=cacheonly"]
"output" = ["type=local,dest=.build/console"]
"lint" = ["type=cacheonly"]
"image" = ["type=docker"]
2025-02-24 21:04:49 +01:00
"generate" = ["type=local,dest=./"]
2025-02-19 01:02:12 +01:00
}[tgt]
tags = {
"build" = []
"output" = []
"lint" = []
2025-02-19 10:09:55 +01:00
"image" = ["${REGISTRY}/console:${GITHUB_SHA}"]
2025-02-24 21:04:49 +01:00
"generate" = []
2025-02-19 01:02:12 +01:00
}[tgt]
2025-02-19 10:20:55 +01:00
cache-to = {
2025-02-19 10:43:58 +01:00
"build" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
"output" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
"lint" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
"image" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
2025-02-24 21:04:49 +01:00
"generate" = ["type=gha,ignore-error=true,mode=max,scope=console-${tgt}"]
2025-02-19 10:20:55 +01:00
}[tgt]
cache-from = {
2025-02-19 10:43:58 +01:00
"build" = ["type=gha,scope=console-${tgt}"]
"output" = ["type=gha,scope=console-${tgt}"]
"lint" = ["type=gha,scope=console-${tgt}"]
"image" = ["type=gha,scope=console-${tgt}"]
2025-02-24 21:04:49 +01:00
"generate" = ["type=gha,scope=console-${tgt}"]
2025-02-19 10:20:55 +01:00
}[tgt]
2025-02-19 01:02:12 +01:00
target = tgt
}
target "_core" {
dockerfile = "Dockerfile.core"
context = "."
contexts = {
2025-02-23 21:54:21 +01:00
golang = "docker-image://golang:1.24"
2025-02-19 01:02:12 +01:00
console = "target:console-output"
}
args = {
SASS_VERSION = "1.64.1"
GOLANG_CI_VERSION = "1.64.5"
}
2025-02-23 21:54:21 +01:00
#platforms = ["linux/amd64", "linux/arm64"]
2025-02-19 01:02:12 +01:00
}
target "core" {
name = "core-${tgt}"
inherits = ["_core"]
matrix = {
2025-02-24 21:04:49 +01:00
tgt = ["build", "output", "lint", "image", "generate", "unit"]
2025-02-19 01:02:12 +01:00
}
output = {
"build" = ["type=cacheonly"]
"output" = ["type=local,dest=.build/core"]
"lint" = ["type=cacheonly"]
2025-02-19 12:02:42 +01:00
"unit" = ["type=cacheonly"]
2025-02-19 01:02:12 +01:00
"image" = ["type=docker"]
2025-02-24 21:04:49 +01:00
"generate" = ["type=local,dest=./"]
2025-02-19 01:02:12 +01:00
}[tgt]
tags = {
"build" = []
"output" = []
"lint" = []
2025-02-19 12:02:42 +01:00
"unit" = []
2025-02-19 10:09:55 +01:00
"image" = ["${REGISTRY}/zitadel:${GITHUB_SHA}"]
2025-02-24 21:04:49 +01:00
"generate" = []
2025-02-19 10:20:55 +01:00
}[tgt]
cache-to = {
2025-02-19 10:43:58 +01:00
"build" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
"output" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
"lint" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
2025-02-19 12:02:42 +01:00
"unit" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
2025-02-19 10:43:58 +01:00
"image" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
2025-02-24 21:04:49 +01:00
"generate" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
2025-02-19 10:20:55 +01:00
}[tgt]
cache-from = {
2025-02-19 10:43:58 +01:00
"build" = ["type=gha,scope=core-${tgt}"]
"output" = ["type=gha,scope=core-${tgt}"]
"lint" = ["type=gha,scope=core-${tgt}"]
2025-02-19 12:02:42 +01:00
"unit" = ["type=gha,scope=core-${tgt}"]
2025-02-19 10:43:58 +01:00
"image" = ["type=gha,scope=core-${tgt}"]
2025-02-24 21:04:49 +01:00
"generate" = ["type=gha,scope=core-${tgt}"]
2025-02-19 01:02:12 +01:00
}[tgt]
target = tgt
2025-02-18 17:40:41 +01:00
}