zitadel/docker-bake.hcl

126 lines
2.7 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-25 21:59:28 +01:00
group "ci" {
targets = ["build", "lint", "unit"]
2025-02-18 22:43:02 +01:00
}
2025-02-24 21:04:49 +01:00
group "generate" {
targets = ["console-generate" , "core-generate"]
}
2025-02-25 21:59:28 +01:00
group "build" {
targets = ["console-build", "core-build"]
2025-02-19 10:12:00 +01:00
}
2025-02-25 21:59:28 +01:00
group "lint" {
targets = ["console-lint", "core-lint"]
2025-02-19 01:02:12 +01:00
}
2025-02-19 17:21:38 +01:00
group "unit" {
targets = ["core-unit"]
}
2025-02-25 21:59:28 +01:00
group "image" {
targets = ["console-image", "core-image"]
}
2025-02-25 18:04:39 +01:00
target "devcontainer" {
dockerfile = "Dockerfile.devcontainer"
context = "."
tags = ["${REGISTRY}/base:${GITHUB_SHA}"]
push = false
}
2025-02-19 01:02:12 +01:00
target "_console" {
dockerfile = "Dockerfile.console"
context = "."
contexts = {
2025-02-25 18:04:39 +01:00
devcontainer = "target:devcontainer"
2025-02-19 01:02:12 +01:00
nginx = "docker-image://nginx:1.27-alpine"
}
}
2025-02-25 15:50:34 +01:00
target "console-generate" {
2025-02-19 01:02:12 +01:00
inherits = ["_console"]
2025-02-25 15:50:34 +01:00
output = ["type=local,dest=./"]
target = "generate"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=console-generate"]
cache-from = ["type=gha,scope=console-generate"]
}
target "console-build" {
inherits = ["_console"]
output = ["type=local,dest=.build/console"]
target = "build"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=console-build"]
cache-from = ["type=gha,scope=console-build"]
2025-02-19 01:02:12 +01:00
}
2025-02-25 21:59:28 +01:00
target "console-lint" {
inherits = ["_console"]
output = ["type=cacheonly"]
target = "lint"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=console-lint"]
cache-from = ["type=gha,scope=console-lint"]
}
2025-02-19 01:02:12 +01:00
target "_core" {
dockerfile = "Dockerfile.core"
context = "."
contexts = {
2025-02-25 18:04:39 +01:00
devcontainer = "target:devcontainer"
2025-02-19 01:02:12 +01:00
}
}
2025-02-25 15:50:34 +01:00
target "core-generate" {
2025-02-19 01:02:12 +01:00
inherits = ["_core"]
2025-02-25 15:50:34 +01:00
output = ["type=local,dest=./"]
target = "generate"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=core-generate"]
cache-from = ["type=gha,scope=core-generate"]
}
target "core-build" {
inherits = ["_core"]
2025-02-25 20:57:53 +01:00
name = "core-build-${os}-${arch}"
matrix = {
os = ["linux", "darwin", "windows"]
arch = ["amd64", "arm64"]
}
args = {
OS = os
ARCH = arch
}
2025-02-25 15:50:34 +01:00
output = ["type=local,dest=.build/core"]
contexts = {
console = "target:console-build"
2025-02-19 01:02:12 +01:00
}
2025-02-25 15:50:34 +01:00
target = "build"
2025-02-25 23:28:09 +01:00
cache-to = ["type=gha,ignore-error=true,mode=max,scope=core-build-${os}-${arch}"]
cache-from = ["type=gha,scope=core-build-${os}-${arch}"]
2025-02-25 21:59:28 +01:00
}
target "core-lint" {
inherits = ["_core"]
output = ["type=cacheonly"]
target = "lint"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=core-lint"]
cache-from = ["type=gha,scope=core-lint"]
}
target "core-unit" {
inherits = ["_core"]
output = ["type=local,dest=.build/core"]
contexts = {
console = "target:console-build"
}
target = "unit"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=core-unit"]
cache-from = ["type=gha,scope=core-unit"]
2025-02-18 17:40:41 +01:00
}