Merge commit '8c008de1d99c0e2e7ba0ff24f032dd7d5ebdb20e' into integrate-login

This commit is contained in:
Elio Bischof
2025-06-23 16:14:05 +02:00
2 changed files with 38 additions and 20 deletions

View File

@@ -3,8 +3,8 @@ export CACHE_DIR ?= $(XDG_CACHE_HOME)/zitadel-make
export LOGIN_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) export LOGIN_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
export BAKE_CLI ?= docker buildx bake export LOGIN_BAKE_CLI ?= docker buildx bake
BAKE_CLI_WITH_COMMON_ARGS := $(BAKE_CLI) --file $(LOGIN_DIR)docker-bake.hcl --file $(LOGIN_DIR)apps/login-test-acceptance/docker-compose.yaml LOGIN_BAKE_CLI_WITH_COMMON_ARGS := $(LOGIN_BAKE_CLI) --file $(LOGIN_DIR)/docker-bake.hcl --file $(LOGIN_DIR)apps/login-test-acceptance/docker-compose.yaml
export COMPOSE_BAKE=true export COMPOSE_BAKE=true
export UID := $(id -u) export UID := $(id -u)
@@ -43,16 +43,16 @@ login-help:
@echo " clean-run-caches - Remove all run caches." @echo " clean-run-caches - Remove all run caches."
login-lint: login-lint:
$(BAKE_CLI_WITH_COMMON_ARGS) login-lint $(LOGIN_BAKE_CLI_WITH_COMMON_ARGS) login-lint
login-test-unit: login-test-unit:
$(BAKE_CLI_WITH_COMMON_ARGS) login-test-unit $(LOGIN_BAKE_CLI_WITH_COMMON_ARGS) login-test-unit
login-test-integration-build: login-test-integration-build:
$(BAKE_CLI_WITH_COMMON_ARGS) core-mock login-test-integration login-standalone $(LOGIN_BAKE_CLI_WITH_COMMON_ARGS) core-mock login-test-integration login-standalone
login-test-integration-dev: login-test-integration-cleanup login-test-integration-dev: login-test-integration-cleanup
$(BAKE_CLI_WITH_COMMON_ARGS) core-mock && docker compose --file $(LOGIN_DIR)apps/login-test-integration/docker-compose.yaml run --service-ports --rm core-mock $(LOGIN_BAKE_CLI_WITH_COMMON_ARGS) core-mock && docker compose --file $(LOGIN_DIR)apps/login-test-integration/docker-compose.yaml run --service-ports --rm core-mock
login-test-integration-run: login-test-integration-cleanup login-test-integration-run: login-test-integration-cleanup
docker compose --file $(LOGIN_DIR)apps/login-test-integration/docker-compose.yaml run --rm integration docker compose --file $(LOGIN_DIR)apps/login-test-integration/docker-compose.yaml run --rm integration
@@ -68,10 +68,10 @@ login-test-integration: login-test-integration-build
$(LOGIN_TEST_INTEGRATION_TAG)" $(LOGIN_TEST_INTEGRATION_TAG)"
login-test-acceptance-build-bake: login-test-acceptance-build-bake:
$(BAKE_CLI_WITH_COMMON_ARGS) login-test-acceptance login-standalone $(LOGIN_BAKE_CLI_WITH_COMMON_ARGS) login-test-acceptance login-standalone
login-test-acceptance-build-compose: login-test-acceptance-build-compose:
$(BAKE_CLI_WITH_COMMON_ARGS) --load setup sink $(LOGIN_BAKE_CLI_WITH_COMMON_ARGS) --load setup sink
login-test-acceptance-build: login-test-acceptance-build-compose login-test-acceptance-build-bake login-test-acceptance-build: login-test-acceptance-build-compose login-test-acceptance-build-bake
@: @:
@@ -103,7 +103,7 @@ login-quality: login-lint login-test-unit login-test-integration
.PHONY: login-standalone-build .PHONY: login-standalone-build
login-standalone-build: login-standalone-build:
$(BAKE_CLI_WITH_COMMON_ARGS) login-standalone $(LOGIN_BAKE_CLI_WITH_COMMON_ARGS) login-standalone
.PHONY: clean-run-caches .PHONY: clean-run-caches
clean-run-caches: clean-run-caches:

View File

@@ -1,30 +1,43 @@
variable "LOGIN_DIR" {
default = "./"
}
variable "DOCKERFILES_DIR" {
default = "${LOGIN_DIR}dockerfiles/"
}
target "login-pnpm" { target "login-pnpm" {
dockerfile = "./dockerfiles/login-pnpm.Dockerfile" context = "${LOGIN_DIR}"
dockerfile = "${DOCKERFILES_DIR}login-pnpm.Dockerfile"
} }
target "login-dev-base" { target "login-dev-base" {
dockerfile = "./dockerfiles/login-dev-base.Dockerfile" dockerfile = "${DOCKERFILES_DIR}login-dev-base.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-pnpm = "target:login-pnpm" login-pnpm = "target:login-pnpm"
} }
} }
target "login-lint" { target "login-lint" {
dockerfile = "./dockerfiles/login-lint.Dockerfile" dockerfile = "${DOCKERFILES_DIR}login-lint.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-dev-base = "target:login-dev-base" login-dev-base = "target:login-dev-base"
} }
} }
target "login-test-unit" { target "login-test-unit" {
dockerfile = "./dockerfiles/login-test-unit.Dockerfile" dockerfile = "${DOCKERFILES_DIR}login-test-unit.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-client = "target:login-client" login-client = "target:login-client"
} }
} }
target "login-client" { target "login-client" {
dockerfile = "./dockerfiles/login-client.Dockerfile" dockerfile = "${DOCKERFILES_DIR}login-client.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-pnpm = "target:login-pnpm" login-pnpm = "target:login-pnpm"
typescript-proto-client = "target:typescript-proto-client" typescript-proto-client = "target:typescript-proto-client"
@@ -32,7 +45,8 @@ target "login-client" {
} }
target "typescript-proto-client" { target "typescript-proto-client" {
dockerfile = "./dockerfiles/typescript-proto-client.Dockerfile" dockerfile = "${DOCKERFILES_DIR}typescript-proto-client.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
# We directly generate and download the client server-side with buf, so we don't need the proto files # We directly generate and download the client server-side with buf, so we don't need the proto files
login-pnpm = "target:login-pnpm" login-pnpm = "target:login-pnpm"
@@ -43,7 +57,8 @@ target "typescript-proto-client" {
# proto-files is only used to build core-mock against which the integration tests run. # proto-files is only used to build core-mock against which the integration tests run.
# To build the proto-client, we use buf to generate and download the client code directly. # To build the proto-client, we use buf to generate and download the client code directly.
target "proto-files" { target "proto-files" {
dockerfile = "./dockerfiles/proto-files.Dockerfile" dockerfile = "${DOCKERFILES_DIR}proto-files.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-pnpm = "target:login-pnpm" login-pnpm = "target:login-pnpm"
} }
@@ -54,7 +69,7 @@ variable "CORE_MOCK_TAG" {
} }
target "core-mock" { target "core-mock" {
context = "./apps/login-test-integration/core-mock" context = "${LOGIN_DIR}apps/login-test-integration/core-mock"
contexts = { contexts = {
protos = "target:proto-files" protos = "target:proto-files"
} }
@@ -67,7 +82,8 @@ variable "LOGIN_TEST_INTEGRATION_TAG" {
} }
target "login-test-integration" { target "login-test-integration" {
dockerfile = "./dockerfiles/login-test-integration.Dockerfile" dockerfile = "${DOCKERFILES_DIR}login-test-integration.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-pnpm = "target:login-pnpm" login-pnpm = "target:login-pnpm"
} }
@@ -80,7 +96,8 @@ variable "LOGIN_TEST_ACCEPTANCE_TAG" {
} }
target "login-test-acceptance" { target "login-test-acceptance" {
dockerfile = "./dockerfiles/login-test-acceptance.Dockerfile" dockerfile = "${DOCKERFILES_DIR}login-test-acceptance.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-pnpm = "target:login-pnpm" login-pnpm = "target:login-pnpm"
} }
@@ -97,7 +114,8 @@ target "docker-metadata-action" {}
# We run integration and acceptance tests against the next standalone server for docker. # We run integration and acceptance tests against the next standalone server for docker.
target "login-standalone" { target "login-standalone" {
inherits = ["docker-metadata-action"] inherits = ["docker-metadata-action"]
dockerfile = "./dockerfiles/login-standalone.Dockerfile" dockerfile = "${DOCKERFILES_DIR}login-standalone.Dockerfile"
context = "${LOGIN_DIR}"
contexts = { contexts = {
login-client = "target:login-client" login-client = "target:login-client"
} }