local dev

This commit is contained in:
Elio Bischof
2025-06-26 10:15:03 +02:00
parent 2b20d8bf35
commit 41743d09a6
8 changed files with 42 additions and 30 deletions

View File

@@ -112,7 +112,7 @@ jobs:
issues: write issues: write
pull-requests: write pull-requests: write
needs: needs:
[version, core-unit-test, core-integration-test, lint, container, e2e, login-container] [version, core-unit-test, core-integration-test, lint, container, login-container, e2e]
if: ${{ github.event_name == 'workflow_dispatch' }} if: ${{ github.event_name == 'workflow_dispatch' }}
secrets: secrets:
GCR_JSON_KEY_BASE64: ${{ secrets.GCR_JSON_KEY_BASE64 }} GCR_JSON_KEY_BASE64: ${{ secrets.GCR_JSON_KEY_BASE64 }}

View File

@@ -34,7 +34,7 @@ jobs:
with: with:
oidc: true oidc: true
- name: Build Login Container - name: Build Login Container
run: make login-standalone-build run: make login_standalone_build
env: env:
# latest if branch is main, otherwise image version which is the pull request number # latest if branch is main, otherwise image version which is the pull request number
BAKE_CLI: depot bake BAKE_CLI: depot bake

View File

@@ -7,10 +7,6 @@ on:
description: 'Ignore run caches' description: 'Ignore run caches'
type: boolean type: boolean
required: true required: true
outputs:
login_build_image:
description: 'The image name of the built production standalone login image'
value: 'ghcr.io/zitadel/login:${{ github.sha }}'
jobs: jobs:
quality: quality:
@@ -50,7 +46,11 @@ jobs:
${{ runner.os }}-login-run-caches-${{github.ref_name}}-${{ github.sha }}- ${{ runner.os }}-login-run-caches-${{github.ref_name}}-${{ github.sha }}-
${{ runner.os }}-login-run-caches-${{github.ref_name}}- ${{ runner.os }}-login-run-caches-${{github.ref_name}}-
${{ runner.os }}-login-run-caches- ${{ runner.os }}-login-run-caches-
- run: make login-quality - uses: actions/download-artifact@v4
with:
path: .artifacts
name: zitadel-linux-amd64
- run: make login_quality
env: env:
# latest if branch is main, otherwise image version which is the pull request number # latest if branch is main, otherwise image version which is the pull request number
LOGIN_BAKE_CLI: depot bake LOGIN_BAKE_CLI: depot bake

View File

@@ -188,7 +188,7 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
version: echo -n "${{ needs.version.outputs.version }}" version: ${{ needs.version.outputs.version }}
cwd: login cwd: login
typescript-repo: typescript-repo:
@@ -199,4 +199,4 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Push Subtree - name: Push Subtree
run: make login-push run: make login_push

View File

@@ -16,6 +16,7 @@ The following files and directories, including their subdirectories, are license
``` ```
proto/ proto/
login/
``` ```
## Community Contributions ## Community Contributions

View File

@@ -20,7 +20,13 @@ LOGIN_REMOTE_BRANCH ?= main
compile: core_build console_build compile_pipeline compile: core_build console_build compile_pipeline
.PHONY: docker_image .PHONY: docker_image
docker_image: compile docker_image:
@if [ ! -f ./zitadel ]; then \
echo "Compiling zitadel binary"; \
$(MAKE) compile; \
else \
echo "Reusing precompiled zitadel binary"; \
fi
DOCKER_BUILDKIT=1 docker build -f build/Dockerfile -t $(ZITADEL_IMAGE) . DOCKER_BUILDKIT=1 docker build -f build/Dockerfile -t $(ZITADEL_IMAGE) .
.PHONY: compile_pipeline .PHONY: compile_pipeline
@@ -170,16 +176,18 @@ core_lint:
--out-format=github-actions \ --out-format=github-actions \
--concurrency=$$(getconf _NPROCESSORS_ONLN) --concurrency=$$(getconf _NPROCESSORS_ONLN)
.PHONY: login-pull .PHONY: login_pull
login-pull: login-ensure-remote login_pull: login_ensure_remote
@echo "Pulling changes from the 'login' subtree on remote $(LOGIN_REMOTE_NAME) branch $(LOGIN_REMOTE_BRANCH)"
git fetch $(LOGIN_REMOTE_NAME) git fetch $(LOGIN_REMOTE_NAME)
git subtree pull --prefix=login $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_BRANCH) git subtree pull --prefix=login $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_BRANCH)
.PHONY: login-push .PHONY: login_push
login-push: login-ensure-remote login_push: login_ensure_remote
@echo "Pushing changes to the 'login' subtree on remote $(LOGIN_REMOTE_NAME) branch $(LOGIN_REMOTE_BRANCH)"
git subtree push --prefix=login $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_BRANCH) git subtree push --prefix=login $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_BRANCH)
login-ensure-remote: login_ensure_remote:
@if ! git remote get-url $(LOGIN_REMOTE_NAME) > /dev/null 2>&1; then \ @if ! git remote get-url $(LOGIN_REMOTE_NAME) > /dev/null 2>&1; then \
echo "Adding remote $(LOGIN_REMOTE_NAME)"; \ echo "Adding remote $(LOGIN_REMOTE_NAME)"; \
git remote add $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_URL); \ git remote add $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_URL); \
@@ -194,9 +202,14 @@ login-ensure-remote:
fi fi
export LOGIN_DIR := ./login/ export LOGIN_DIR := ./login/
export LOGIN_BAKE_CLI_ADDITIONAL_ARGS := --set login-*.context=./login/ --file ./docker-bake.hcl export LOGIN_BAKE_CLI_ADDITIONAL_ARGS := --set login-*.context=./login/ --file ./docker-bake.hcl
export ZITADEL_TAG := "$(ZITADEL_IMAGE)" export ZITADEL_TAG ?= $(ZITADEL_IMAGE)
#include login/Makefile include login/Makefile
#login-test-acceptance-build: docker_image login-test-acceptance-build-compose login-test-acceptance-build-bake # Intentional override of login_test_acceptance_build
# @: login_test_acceptance_build: docker_image
@echo "Building login test acceptance environment with the local zitadel image"
$(MAKE) login_test_acceptance_build_compose login_test_acceptance_build_bake
login_dev: docker_image typescript_generate login_test_acceptance_build_compose login_test_acceptance_cleanup login_test_acceptance_setup_dev
@echo "Starting login test environment with the local zitadel image"

View File

@@ -0,0 +1,3 @@
*
!build/entrypoint.sh
!zitadel

View File

@@ -1,8 +1,10 @@
target "zitadel" { target "typescript-proto-client" {
dockerfile = "build/Dockerfile" contexts = {
proto-files = "target:proto-files"
}
} }
target "typescript-proto-client" { target "typescript-proto-client-out" {
contexts = { contexts = {
proto-files = "target:proto-files" proto-files = "target:proto-files"
} }
@@ -10,10 +12,3 @@ target "typescript-proto-client" {
"type=local,dest=login/packages/zitadel-proto" "type=local,dest=login/packages/zitadel-proto"
] ]
} }
target "typescript-proto-client-out" {
output = [
"type=local,dest=login/packages/zitadel-proto"
]
}