diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eff6805721..8bc6c0e728 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,7 +112,7 @@ jobs: issues: write pull-requests: write 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' }} secrets: GCR_JSON_KEY_BASE64: ${{ secrets.GCR_JSON_KEY_BASE64 }} diff --git a/.github/workflows/login-container.yml b/.github/workflows/login-container.yml index 82a9a17389..24cb82016d 100644 --- a/.github/workflows/login-container.yml +++ b/.github/workflows/login-container.yml @@ -34,7 +34,7 @@ jobs: with: oidc: true - name: Build Login Container - run: make login-standalone-build + run: make login_standalone_build env: # latest if branch is main, otherwise image version which is the pull request number BAKE_CLI: depot bake diff --git a/.github/workflows/login-quality.yml b/.github/workflows/login-quality.yml index bbeda75c43..45d030f875 100644 --- a/.github/workflows/login-quality.yml +++ b/.github/workflows/login-quality.yml @@ -7,10 +7,6 @@ on: description: 'Ignore run caches' type: boolean 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: quality: @@ -50,7 +46,11 @@ jobs: ${{ runner.os }}-login-run-caches-${{github.ref_name}}-${{ github.sha }}- ${{ runner.os }}-login-run-caches-${{github.ref_name}}- ${{ 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: # latest if branch is main, otherwise image version which is the pull request number LOGIN_BAKE_CLI: depot bake diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a6cb54ffb..5f93679d73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -188,7 +188,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - version: echo -n "${{ needs.version.outputs.version }}" + version: ${{ needs.version.outputs.version }} cwd: login typescript-repo: @@ -199,4 +199,4 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Push Subtree - run: make login-push + run: make login_push diff --git a/LICENSING.md b/LICENSING.md index 9cad2082f8..f8e78c4d92 100644 --- a/LICENSING.md +++ b/LICENSING.md @@ -16,6 +16,7 @@ The following files and directories, including their subdirectories, are license ``` proto/ +login/ ``` ## Community Contributions diff --git a/Makefile b/Makefile index d9be50f1d1..10f52b7c4c 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,13 @@ LOGIN_REMOTE_BRANCH ?= main compile: core_build console_build compile_pipeline .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) . .PHONY: compile_pipeline @@ -170,16 +176,18 @@ core_lint: --out-format=github-actions \ --concurrency=$$(getconf _NPROCESSORS_ONLN) -.PHONY: login-pull -login-pull: login-ensure-remote +.PHONY: login_pull +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 subtree pull --prefix=login $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_BRANCH) -.PHONY: login-push -login-push: login-ensure-remote +.PHONY: login_push +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) -login-ensure-remote: +login_ensure_remote: @if ! git remote get-url $(LOGIN_REMOTE_NAME) > /dev/null 2>&1; then \ echo "Adding remote $(LOGIN_REMOTE_NAME)"; \ git remote add $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_URL); \ @@ -194,9 +202,14 @@ login-ensure-remote: fi export LOGIN_DIR := ./login/ -export LOGIN_BAKE_CLI_ADDITIONAL_ARGS := --set login-*.context=./login/ --file ./docker-bake.hcl -export ZITADEL_TAG := "$(ZITADEL_IMAGE)" -#include login/Makefile +export LOGIN_BAKE_CLI_ADDITIONAL_ARGS := --set login-*.context=./login/ --file ./docker-bake.hcl +export ZITADEL_TAG ?= $(ZITADEL_IMAGE) +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" diff --git a/build/Dockerfile.gitignore b/build/Dockerfile.gitignore new file mode 100644 index 0000000000..a2cc8ed480 --- /dev/null +++ b/build/Dockerfile.gitignore @@ -0,0 +1,3 @@ +* +!build/entrypoint.sh +!zitadel diff --git a/docker-bake.hcl b/docker-bake.hcl index 787cee3b36..72cb37cf05 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,8 +1,10 @@ -target "zitadel" { - dockerfile = "build/Dockerfile" +target "typescript-proto-client" { + contexts = { + proto-files = "target:proto-files" + } } -target "typescript-proto-client" { +target "typescript-proto-client-out" { contexts = { proto-files = "target:proto-files" } @@ -10,10 +12,3 @@ target "typescript-proto-client" { "type=local,dest=login/packages/zitadel-proto" ] } - -target "typescript-proto-client-out" { - output = [ - "type=local,dest=login/packages/zitadel-proto" - ] -} -