chore(make): add docker_image make target (#7440)

This commit is contained in:
Tim Möhlmann 2024-02-27 18:29:09 +02:00 committed by GitHub
parent 53099a282a
commit 2801167668
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 8 deletions

View File

@ -207,18 +207,15 @@ Repeat the above with `INTEGRATION_DB_FLAVOR="postgres"`.
To test the whole system, including the console UI and the login UI, run the E2E tests. To test the whole system, including the console UI and the login UI, run the E2E tests.
```bash ```bash
# Build the production binary # Build the production docker image
make core_build console_build export ZITADEL_IMAGE=zitadel:local GOOS=linux
GOOS=linux make compile_pipeline make docker_image
# Pack the binary into a docker image
DOCKER_BUILDKIT=1 docker build --file build/Dockerfile . -t zitadel:local
# If you made changes in the e2e directory, make sure you reformat the files # If you made changes in the e2e directory, make sure you reformat the files
make console_lint make console_lint
# Run the tests # Run the tests
ZITADEL_IMAGE=zitadel:local docker compose --file ./e2e/config/host.docker.internal/docker-compose.yaml run --service-ports e2e docker compose --file ./e2e/config/host.docker.internal/docker-compose.yaml run --service-ports e2e
``` ```
When you are happy with your changes, you can cleanup your environment. When you are happy with your changes, you can cleanup your environment.

View File

@ -5,10 +5,15 @@ gen_zitadel_path := "$(go_bin)/protoc-gen-zitadel"
now := $(shell date --rfc-3339=seconds | sed 's/ /T/') now := $(shell date --rfc-3339=seconds | sed 's/ /T/')
VERSION ?= development-$(now) VERSION ?= development-$(now)
COMMIT_SHA ?= $(shell git rev-parse HEAD) COMMIT_SHA ?= $(shell git rev-parse HEAD)
ZITADEL_IMAGE ?= zitadel:local
.PHONY: compile .PHONY: compile
compile: core_build console_build compile_pipeline compile: core_build console_build compile_pipeline
.PHONY: docker_image
docker_image: compile
DOCKER_BUILDKIT=1 docker build -f build/Dockerfile -t $(ZITADEL_IMAGE) .
.PHONY: compile_pipeline .PHONY: compile_pipeline
compile_pipeline: console_move compile_pipeline: console_move
CGO_ENABLED=0 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=$(COMMIT_SHA)' -X 'github.com/zitadel/zitadel/cmd/build.date=$(now)' -X 'github.com/zitadel/zitadel/cmd/build.version=$(VERSION)' " CGO_ENABLED=0 go build -o zitadel -v -ldflags="-s -w -X 'github.com/zitadel/zitadel/cmd/build.commit=$(COMMIT_SHA)' -X 'github.com/zitadel/zitadel/cmd/build.date=$(now)' -X 'github.com/zitadel/zitadel/cmd/build.version=$(VERSION)' "
@ -115,7 +120,7 @@ console_lint:
cd console && \ cd console && \
yarn lint yarn lint
.PHONE: core_lint .PHONY: core_lint
core_lint: core_lint:
golangci-lint run \ golangci-lint run \
--timeout 10m \ --timeout 10m \