mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 08:47:32 +00:00
s o c
This commit is contained in:
38
Makefile
38
Makefile
@@ -1,4 +1,4 @@
|
||||
LOGIN_DEPENDENCIES_TAG ?= "zitadel-login-dev-dependencies:local"
|
||||
LOGIN_DEPENDENCIES_TAG ?= "zitadel-login-dependencies:local"
|
||||
LOGIN_IMAGE_TAG ?= "zitadel-login:local"
|
||||
CORE_MOCK_TAG ?= "zitadel-core-mock:local"
|
||||
LOGIN_INTEGRATION_TESTSUITE_TAG ?= "zitadel-login-integration-testsuite:local"
|
||||
@@ -20,17 +20,17 @@ help:
|
||||
@echo " login-unit-force - Force run unit tests"
|
||||
@echo " login-integration - Run integration tests"
|
||||
@echo " login-integration-force - Force run integration tests"
|
||||
@echo " login-image - Build the login image"
|
||||
@echo " login-standalone - Build the docker image for production login containers"
|
||||
@echo " login-quality - Run all quality checks (login-lint, unit, integration)"
|
||||
@echo " login-ci - Run all CI tasks. Run it with the -j flag to parallelize. make -j ci"
|
||||
@echo " show-cache - Show cached digests and exit codes"
|
||||
@echo " clean-cache - Remove the cache directory"
|
||||
@echo " show-cache-keys - Show all cache keys with image ids and exit codes"
|
||||
@echo " clean-cache-keys - Remove all cache keys"
|
||||
@echo " core-mock - Start the core mock server"
|
||||
@echo " core-mock-stop - Stop the core mock server"
|
||||
|
||||
|
||||
.PHONY: login-lint-force
|
||||
login-lint-force: login-dev-dependencies
|
||||
login-lint-force: login-dependencies
|
||||
docker run --rm $(LOGIN_DEPENDENCIES_TAG) lint
|
||||
docker run --rm $(LOGIN_DEPENDENCIES_TAG) format --check
|
||||
|
||||
@@ -39,7 +39,7 @@ login-lint:
|
||||
./scripts/run_or_skip.sh login-lint-force $(LOGIN_DEPENDENCIES_TAG)
|
||||
|
||||
.PHONY: login-unit-force
|
||||
login-unit-force: login-dev-dependencies
|
||||
login-unit-force: login-dependencies
|
||||
docker run --rm $(LOGIN_DEPENDENCIES_TAG) test:unit
|
||||
|
||||
.PHONY: login-unit
|
||||
@@ -62,18 +62,18 @@ login-quality-after-build: login-lint login-unit login-integration
|
||||
|
||||
.PHONY: login-ci
|
||||
login-ci: core-mock-build login-ci-after-build
|
||||
login-ci-after-build: login-quality-after-build login-image
|
||||
login-ci-after-build: login-quality-after-build login-standalone
|
||||
@:
|
||||
|
||||
login-dev-dependencies:
|
||||
docker buildx bake login-dev-dependencies --set login-dev-dependencies.tags=$(LOGIN_DEPENDENCIES_TAG);
|
||||
login-dependencies:
|
||||
docker buildx bake login-dependencies --set login-dependencies.tags=$(LOGIN_DEPENDENCIES_TAG);
|
||||
|
||||
.PHONY: login-image
|
||||
login-image:
|
||||
docker buildx bake login-image --set login-image.tags=$(LOGIN_IMAGE_TAG);
|
||||
.PHONY: login-standalone
|
||||
login-standalone:
|
||||
docker buildx bake login-standalone --set login-standalone.tags=$(LOGIN_IMAGE_TAG);
|
||||
|
||||
.PHONY: login
|
||||
login: login-image login-stop
|
||||
login: login-standalone login-stop
|
||||
docker run --detach --rm --name $(LOGIN_CONTAINER_NAME) --publish 3000:3000 $(LOGIN_IMAGE_TAG)
|
||||
|
||||
login-stop:
|
||||
@@ -82,7 +82,7 @@ login-stop:
|
||||
core-mock-build:
|
||||
docker buildx bake core-mock --set core-mock.tags=$(CORE_MOCK_TAG);
|
||||
|
||||
login-integration-testsuite: login-dev-dependencies
|
||||
login-integration-testsuite: login-dependencies
|
||||
docker buildx bake login-integration-testsuite --set login-integration-testsuite.tags=$(LOGIN_INTEGRATION_TESTSUITE_TAG)
|
||||
|
||||
.PHONY: core-mock
|
||||
@@ -93,14 +93,14 @@ core-mock: core-mock-build core-mock-stop
|
||||
core-mock-stop:
|
||||
docker rm --force $(CORE_MOCK_CONTAINER_NAME) 2>/dev/null || true
|
||||
|
||||
.PHONY: clean-cache
|
||||
clean-cache:
|
||||
.PHONY: clean-cache-keys
|
||||
clean-cache-keys:
|
||||
@echo "Removing cache directory: $(CACHE_DIR)"
|
||||
rm -rf "$(CACHE_DIR)"
|
||||
|
||||
.PHONY: show-cache
|
||||
show-cache:
|
||||
@echo "Showing cached digests and exit codes in $(CACHE_DIR):"
|
||||
.PHONY: show-cache-keys
|
||||
show-cache-keys:
|
||||
@echo "Showing cache keys with docker image ids and exit codes in $(CACHE_DIR):"
|
||||
@find "$(CACHE_DIR)" -type f 2>/dev/null | while read file; do \
|
||||
echo "$$file: $$(cat $$file)"; \
|
||||
done
|
||||
|
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"extends": ["///"],
|
||||
"extends": ["//"],
|
||||
"tasks": {
|
||||
"test": {
|
||||
"dependsOn": ["@zitadel/client#build"]
|
||||
},
|
||||
"test:integration": {
|
||||
"dependsOn": ["@zitadel/client#build"]
|
||||
},
|
@@ -1,6 +0,0 @@
|
||||
FROM cypress/factory AS login-integration-testsuite
|
||||
WORKDIR /opt/app
|
||||
COPY --from=login-dev-dependencies /app/apps/login/node_modules .
|
||||
RUN npx cypress install
|
||||
COPY . .
|
||||
CMD ["npx", "cypress", "run"]
|
@@ -4,12 +4,8 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "pnpm exec next dev --turbopack",
|
||||
"test": "pnpm exec concurrently --timings --kill-others-on-fail 'npm:test:unit' 'npm:test:integration'",
|
||||
"test:watch": "pnpm exec oncurrently --kill-others 'npm:test:unit:watch' 'npm:test:integration:watch'",
|
||||
"test:unit": "pnpm exec vitest",
|
||||
"test:unit:watch": "pnpm test:unit --watch",
|
||||
"mock": "pnpm mock:stop && docker run --rm --name zitadel-mock-grpc-server --publish 22220:22220 --publish 22222:22222 ${CORE_MOCK_TAG:-zitadel-core-mock:local}",
|
||||
"mock:stop": "docker rm --force zitadel-mock-grpc-server 2>/dev/null || true",
|
||||
"lint": "pnpm exec next lint && pnpm exec prettier --check .",
|
||||
"lint:fix": "pnpm exec prettier --write .",
|
||||
"lint-staged": "lint-staged",
|
||||
@@ -66,7 +62,6 @@
|
||||
"@zitadel/tailwind-config": "workspace:*",
|
||||
"@zitadel/tsconfig": "workspace:*",
|
||||
"autoprefixer": "10.4.21",
|
||||
"concurrently": "^9.1.2",
|
||||
"grpc-tools": "1.13.0",
|
||||
"jsdom": "^26.1.0",
|
||||
"lint-staged": "15.5.1",
|
||||
|
@@ -6,17 +6,25 @@ target "login-platform" {
|
||||
dockerfile = "dockerfiles/login-platform.Dockerfile"
|
||||
}
|
||||
|
||||
target "login-dev-base" {
|
||||
dockerfile = "dockerfiles/login-dev-base.Dockerfile"
|
||||
target "login-base" {
|
||||
dockerfile = "dockerfiles/login-base.Dockerfile"
|
||||
contexts = {
|
||||
login-platform = "target:login-platform"
|
||||
}
|
||||
}
|
||||
|
||||
target "login-dev-dependencies" {
|
||||
dockerfile = "dockerfiles/login-dev-dependencies.Dockerfile"
|
||||
target "login-dependencies" {
|
||||
dockerfile = "dockerfiles/login-dependencies.Dockerfile"
|
||||
contexts = {
|
||||
login-dev-base = "target:login-dev-base"
|
||||
login-base = "target:login-base"
|
||||
}
|
||||
}
|
||||
|
||||
target "typescript-proto-client" {
|
||||
dockerfile = "dockerfiles/typescript-proto-client.Dockerfile"
|
||||
contexts = {
|
||||
# We directly generate and download the client server-side with buf, so we don't need the proto files
|
||||
login-base = "target:login-dependencies"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,41 +33,29 @@ target "login-dev-dependencies" {
|
||||
target "proto-files" {
|
||||
dockerfile = "dockerfiles/proto-files.Dockerfile"
|
||||
contexts = {
|
||||
login-dev-base = "target:login-dev-dependencies"
|
||||
login-base = "target:login-dependencies"
|
||||
}
|
||||
}
|
||||
|
||||
target "core-mock" {
|
||||
context = "apps/login/mock"
|
||||
dockerfile = "Dockerfile"
|
||||
context = "apps/core-mock"
|
||||
contexts = {
|
||||
protos = "target:proto-files"
|
||||
}
|
||||
}
|
||||
|
||||
target "login-integration-testsuite" {
|
||||
context = "apps/login/cypress"
|
||||
contexts = {
|
||||
login-dev-dependencies = "target:login-dev-dependencies"
|
||||
}
|
||||
}
|
||||
|
||||
target "typescript-proto-client" {
|
||||
dockerfile = "dockerfiles/typescript-proto-client.Dockerfile"
|
||||
contexts = {
|
||||
# We directly generate and download the client server-side with buf, so we don't need the proto files
|
||||
login-dev-base = "target:login-dev-dependencies"
|
||||
}
|
||||
dockerfile = "dockerfiles/login-integration-testsuite.Dockerfile"
|
||||
}
|
||||
|
||||
# We run integration and acceptance tests against the next standalone server for docker.
|
||||
target "login-image" {
|
||||
dockerfile = "dockerfiles/login-image.Dockerfile"
|
||||
target "login-standalone" {
|
||||
dockerfile = "dockerfiles/login-standalone.Dockerfile"
|
||||
args = {
|
||||
NODE_ENV = "production"
|
||||
}
|
||||
contexts = {
|
||||
login-platform = "target:login-platform"
|
||||
login-dev-base = "target:login-dev-dependencies"
|
||||
login-base = "target:login-dependencies"
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,6 @@
|
||||
FROM login-platform AS login-dev-base
|
||||
|
||||
FROM login-platform AS login-base
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
RUN corepack enable
|
||||
|
||||
RUN apk add --no-cache libc6-compat bash git
|
||||
|
||||
WORKDIR /app
|
@@ -1,5 +1,4 @@
|
||||
FROM login-dev-base AS login-dev-dependencies
|
||||
|
||||
FROM login-base AS login-dependencies
|
||||
COPY \
|
||||
turbo.json \
|
||||
.npmrc \
|
||||
@@ -7,8 +6,6 @@ COPY \
|
||||
pnpm-lock.yaml \
|
||||
pnpm-workspace.yaml \
|
||||
./
|
||||
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY packages/zitadel-client/package.json ./packages/zitadel-client/
|
||||
COPY packages/zitadel-eslint-config/package.json ./packages/zitadel-eslint-config/
|
||||
COPY packages/zitadel-prettier-config/package.json ./packages/zitadel-prettier-config/
|
||||
@@ -16,9 +13,6 @@ COPY packages/zitadel-proto/package.json ./packages/zitadel-proto/
|
||||
COPY packages/zitadel-tailwind-config/package.json ./packages/zitadel-tailwind-config/
|
||||
COPY packages/zitadel-tsconfig/package.json ./packages/zitadel-tsconfig/
|
||||
COPY apps/login/package.json ./apps/login/
|
||||
COPY apps/login/cypress/package.json ./apps/login/cypress/
|
||||
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
ENTRYPOINT ["pnpm"]
|
15
dockerfiles/login-integration-testsuite.Dockerfile
Normal file
15
dockerfiles/login-integration-testsuite.Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM cypress/factory AS login-integration-testsuite
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
WORKDIR /opt/app
|
||||
COPY \
|
||||
pnpm-lock.yaml \
|
||||
pnpm-workspace.yaml \
|
||||
./
|
||||
COPY ./apps/login-integration-testsuite/package.json ./apps/login-integration-testsuite/package.json
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
RUN pnpm exec cypress install
|
||||
COPY ./apps/login-integration-testsuite/ .
|
||||
CMD ["pnpm", "exec", "cypress", "run"]
|
@@ -1,34 +1,22 @@
|
||||
FROM login-dev-base AS prune-for-docker
|
||||
|
||||
FROM login-base AS prune-for-docker
|
||||
RUN pnpm install turbo --global
|
||||
|
||||
COPY . .
|
||||
RUN turbo prune @zitadel/login --docker
|
||||
|
||||
FROM login-dev-base AS installer
|
||||
|
||||
FROM login-base AS installer
|
||||
COPY --from=prune-for-docker /app/out/json/ .
|
||||
RUN pnpm install --frozen-lockfile
|
||||
COPY --from=prune-for-docker /app/out/full/ .
|
||||
RUN NEXT_PUBLIC_BASE_PATH=/ui/v2/login NEXT_OUTPUT_MODE=standalone pnpm exec turbo run build
|
||||
|
||||
RUN ls -la /app/apps/login/.next
|
||||
|
||||
FROM login-platform AS login-image
|
||||
|
||||
FROM login-platform AS login-standalone
|
||||
WORKDIR /app
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs && \
|
||||
adduser --system --uid 1001 nextjs
|
||||
|
||||
# If /.env-file/.env is mounted into the container, its variables are made available to the server before it starts up.
|
||||
RUN mkdir -p /.env-file && touch /.env-file/.env && chown -R nextjs:nodejs /.env-file
|
||||
|
||||
COPY --chown=nextjs:nodejs --from=installer /app/apps/login/.next/standalone ./
|
||||
COPY --chown=nextjs:nodejs --from=installer /app/apps/login/.next/static ./apps/login/.next/static
|
||||
COPY --chown=nextjs:nodejs --from=installer /app/apps/login/public ./apps/login/public
|
||||
|
||||
USER nextjs
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
|
||||
CMD ["/bin/sh", "-c", " set -o allexport && . /.env-file/.env && set +o allexport && node apps/login/server.js"]
|
@@ -1,10 +1,8 @@
|
||||
FROM bufbuild/buf:1.54.0 AS proto-files
|
||||
|
||||
RUN buf export https://github.com/envoyproxy/protoc-gen-validate.git --path validate --output /proto-files && \
|
||||
buf export https://github.com/grpc-ecosystem/grpc-gateway.git --path protoc-gen-openapiv2 --output /proto-files && \
|
||||
buf export https://github.com/googleapis/googleapis.git --path google/api/annotations.proto --path google/api/http.proto --path google/api/field_behavior.proto --output /proto-files && \
|
||||
buf export https://github.com/zitadel/zitadel.git --path ./proto/zitadel --output /proto-files
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=proto-files /proto-files /
|
||||
|
@@ -1,9 +1,6 @@
|
||||
FROM login-dev-base AS zitadel-proto
|
||||
|
||||
FROM login-base AS zitadel-proto
|
||||
COPY packages/zitadel-proto packages/zitadel-proto
|
||||
|
||||
RUN pnpm generate
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=zitadel-proto /app/packages/zitadel-proto /
|
||||
|
17
pnpm-lock.yaml
generated
17
pnpm-lock.yaml
generated
@@ -189,9 +189,6 @@ importers:
|
||||
autoprefixer:
|
||||
specifier: 10.4.21
|
||||
version: 10.4.21(postcss@8.5.3)
|
||||
concurrently:
|
||||
specifier: ^9.1.2
|
||||
version: 9.1.2
|
||||
grpc-tools:
|
||||
specifier: 1.13.0
|
||||
version: 1.13.0
|
||||
@@ -223,7 +220,7 @@ importers:
|
||||
specifier: ^5.8.3
|
||||
version: 5.8.3
|
||||
|
||||
apps/login/cypress:
|
||||
apps/login-integration-testsuite:
|
||||
devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^22.14.1
|
||||
@@ -2029,10 +2026,6 @@ packages:
|
||||
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
cross-spawn@7.0.5:
|
||||
resolution: {integrity: sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
cross-spawn@7.0.6:
|
||||
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
|
||||
engines: {node: '>= 8'}
|
||||
@@ -6492,12 +6485,6 @@ snapshots:
|
||||
shebang-command: 2.0.0
|
||||
which: 2.0.2
|
||||
|
||||
cross-spawn@7.0.5:
|
||||
dependencies:
|
||||
path-key: 3.1.1
|
||||
shebang-command: 2.0.0
|
||||
which: 2.0.2
|
||||
|
||||
cross-spawn@7.0.6:
|
||||
dependencies:
|
||||
path-key: 3.1.1
|
||||
@@ -6740,7 +6727,7 @@ snapshots:
|
||||
env-cmd@10.1.0:
|
||||
dependencies:
|
||||
commander: 4.1.1
|
||||
cross-spawn: 7.0.5
|
||||
cross-spawn: 7.0.6
|
||||
|
||||
environment@1.1.0: {}
|
||||
|
||||
|
@@ -1,4 +1,3 @@
|
||||
packages:
|
||||
- "apps/*"
|
||||
- "apps/login/cypress"
|
||||
- "packages/*"
|
||||
|
Reference in New Issue
Block a user