This commit is contained in:
Elio Bischof
2025-06-18 10:32:08 +02:00
parent c3e781e308
commit fbbb2aa6d5
3 changed files with 51 additions and 20 deletions

View File

@@ -35,10 +35,11 @@ jobs:
with:
project: jp837jn3fm
push: false
targets: login-lint
targets: login-lint,login-test-unit,login-test-integration,login-test-acceptance
files: |
docker-bake.hcl
docker-bake-ci.hcl
env:
# latest if branch is main, otherwise image version which is the pull request number
BUILD_CACHE_KEY: ${{ github.ref == 'refs/heads/main' && 'latest' || fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
- run: make quality

View File

@@ -4,25 +4,46 @@ target "login-pnpm" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
output = [
{ type : "image", name: "${IMAGE_REGISTRY}/login-pnpm:${BUILD_CACHE_KEY}", push: true },
]
}
target "login-dev-base" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
output = [
{ type : "image", name: "${IMAGE_REGISTRY}/login-dev-base:${BUILD_CACHE_KEY}", push: true },
]
}
target "login-lint" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
output = [
{ type : "image", name: "${IMAGE_REGISTRY}/login-lint:${BUILD_CACHE_KEY}", push: true },
}
target "login-test-unit" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-test-unit-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
}
target "login-test-integration" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-test-integration-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
}
target "login-client" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-client-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
}
target "login-test-acceptance" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-test-acceptance-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
}
target "login-standalone" {
cache-to = [
{ type: "registry", ref: "${IMAGE_REGISTRY}/login-buildcache:${BUILD_CACHE_KEY}", mode: "max", oci-mediatypes=true }
]
}

View File

@@ -8,12 +8,7 @@ variable "BUILD_CACHE_KEY" {
default = "local"
}
target "_platforms" {
platforms = ["linux/amd64"]
}
target "login-pnpm" {
inherits = ["_platforms"]
cache-from = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}" },
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:latest" },
@@ -22,7 +17,6 @@ target "login-pnpm" {
}
target "login-dev-base" {
inherits = ["_platforms"]
cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}"},
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:latest"},
@@ -34,7 +28,6 @@ target "login-dev-base" {
}
target "login-lint" {
inherits = ["_platforms"]
cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}"},
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:latest"},
@@ -45,11 +38,11 @@ target "login-lint" {
}
}
variable "LOGIN_TEST_UNIT_TAG" {
default = "login-test-unit:local"
}
target "login-test-unit" {
cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-unit-buildcache:${BUILD_CACHE_KEY}"},
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-unit-buildcache:latest"},
]
dockerfile = "dockerfiles/login-test-unit.Dockerfile"
contexts = {
login-client = "target:login-client"
@@ -59,6 +52,10 @@ target "login-test-unit" {
}
target "login-client" {
cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-client-buildcache:${BUILD_CACHE_KEY}"},
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-client-buildcache:latest"},
]
dockerfile = "dockerfiles/login-client.Dockerfile"
contexts = {
login-pnpm = "target:login-pnpm"
@@ -100,6 +97,10 @@ variable "LOGIN_TEST_INTEGRATION_TAG" {
}
target "login-test-integration" {
cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-integration-buildcache:${BUILD_CACHE_KEY}"},
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-integration-buildcache:latest"},
]
dockerfile = "dockerfiles/login-test-integration.Dockerfile"
contexts = {
login-pnpm = "target:login-pnpm"
@@ -112,6 +113,10 @@ variable "LOGIN_TEST_ACCEPTANCE_TAG" {
}
target "login-test-acceptance" {
cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-acceptance-buildcache:${BUILD_CACHE_KEY}"},
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-acceptance-buildcache:latest"},
]
dockerfile = "dockerfiles/login-test-acceptance.Dockerfile"
contexts = {
login-pnpm = "target:login-pnpm"
@@ -125,6 +130,10 @@ variable "LOGIN_TAG" {
# We run integration and acceptance tests against the next standalone server for docker.
target "login-standalone" {
cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-buildcache:${BUILD_CACHE_KEY}"},
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-buildcache:latest"},
]
dockerfile = "dockerfiles/login-standalone.Dockerfile"
contexts = {
login-client = "target:login-client"