mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 12:47:35 +00:00
integration
This commit is contained in:
9
.devcontainer/Dockerfile
Normal file
9
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM mcr.microsoft.com/devcontainers/base:ubuntu
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
RUN apt-get --no-install-recommends install -y \
|
||||||
|
libgtk2.0-0t64 libgtk-3-0t64 libgbm-dev libnotify-dev libnss3 libxss1 libasound2t64 libxtst6 xauth xvfb && \
|
||||||
|
# clean up
|
||||||
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
apt-get clean
|
@@ -2,7 +2,7 @@
|
|||||||
"name": "zitadel",
|
"name": "zitadel",
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
"service": "devcontainer",
|
"service": "devcontainer",
|
||||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
"workspaceFolder": "/workspaces",
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/go:1": {
|
"ghcr.io/devcontainers/features/go:1": {
|
||||||
"version": "1.24"
|
"version": "1.24"
|
||||||
@@ -11,12 +11,21 @@
|
|||||||
"version": "lts/iron"
|
"version": "lts/iron"
|
||||||
},
|
},
|
||||||
"ghcr.io/guiyomh/features/golangci-lint:0": {},
|
"ghcr.io/guiyomh/features/golangci-lint:0": {},
|
||||||
"ghcr.io/jungaretti/features/make:1": {}
|
"ghcr.io/jungaretti/features/make:1": {},
|
||||||
|
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
|
||||||
},
|
},
|
||||||
"forwardPorts": [
|
"forwardPorts": [
|
||||||
3000,
|
3000,
|
||||||
|
3001,
|
||||||
4200,
|
4200,
|
||||||
8080
|
8080
|
||||||
],
|
],
|
||||||
"onCreateCommand": "npm install -g sass@1.64.1"
|
"onCreateCommand": "npm install -g sass@1.64.1",
|
||||||
|
"customizations": {
|
||||||
|
"jetbrains": {
|
||||||
|
"settings": {
|
||||||
|
"com.intellij:app:HttpConfigurable.use_proxy_pac": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,19 @@
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
devcontainer:
|
devcontainer:
|
||||||
image: mcr.microsoft.com/devcontainers/base:ubuntu
|
build:
|
||||||
|
context: .
|
||||||
volumes:
|
volumes:
|
||||||
- ..:/workspaces:cached
|
- ..:/workspaces:cached
|
||||||
|
- /tmp/.X11-unix:/tmp/.X11-unix:cached
|
||||||
|
- ~/.cache:/home/vscode/.cache:delegated
|
||||||
command: sleep infinity
|
command: sleep infinity
|
||||||
|
working_dir: /workspaces
|
||||||
environment:
|
environment:
|
||||||
ZITADEL_DATABASE_POSTGRES_HOST: db
|
ZITADEL_DATABASE_POSTGRES_HOST: db
|
||||||
ZITADEL_EXTERNALSECURE: false
|
ZITADEL_EXTERNALSECURE: false
|
||||||
|
ports:
|
||||||
|
- 3001:3001
|
||||||
|
|
||||||
db:
|
db:
|
||||||
container_name: db
|
container_name: db
|
||||||
@@ -35,6 +41,18 @@ services:
|
|||||||
- 22220:22220
|
- 22220:22220
|
||||||
- 22222:22222
|
- 22222:22222
|
||||||
|
|
||||||
|
login-integration:
|
||||||
|
container_name: login-integration
|
||||||
|
image: "${LOGIN_TAG:-ghcr.io/zitadel/zitadel-login:v4.0.0-rc.2}"
|
||||||
|
volumes:
|
||||||
|
- ../apps/login/apps/login/.env.test:/env-files/.env:cached
|
||||||
|
network_mode: service:devcontainer
|
||||||
|
environment:
|
||||||
|
PORT: 3001
|
||||||
|
depends_on:
|
||||||
|
mock-zitadel:
|
||||||
|
condition: service_started
|
||||||
|
|
||||||
zitadel:
|
zitadel:
|
||||||
image: "${ZITADEL_TAG:-ghcr.io/zitadel/zitadel:v4.0.0-rc.2}"
|
image: "${ZITADEL_TAG:-ghcr.io/zitadel/zitadel:v4.0.0-rc.2}"
|
||||||
container_name: zitadel
|
container_name: zitadel
|
||||||
@@ -68,7 +86,7 @@ services:
|
|||||||
WRITE_ENVIRONMENT_FILE: /login-env/.env.test.local
|
WRITE_ENVIRONMENT_FILE: /login-env/.env.test.local
|
||||||
SINK_EMAIL_INTERNAL_URL: http://sink:3333/email
|
SINK_EMAIL_INTERNAL_URL: http://sink:3333/email
|
||||||
SINK_SMS_INTERNAL_URL: http://sink:3333/sms
|
SINK_SMS_INTERNAL_URL: http://sink:3333/sms
|
||||||
SINK_NOTIFICATION_URL: http://localhost:3333/notification
|
SINK_NOTIFICATION_URL: http://sink:3333/notification
|
||||||
LOGIN_BASE_URL: http://localhost:3000/ui/v2/login/
|
LOGIN_BASE_URL: http://localhost:3000/ui/v2/login/
|
||||||
ZITADEL_API_DOMAIN: localhost
|
ZITADEL_API_DOMAIN: localhost
|
||||||
ZITADEL_ADMIN_USER: zitadel-admin@zitadel.localhost
|
ZITADEL_ADMIN_USER: zitadel-admin@zitadel.localhost
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -94,3 +94,6 @@ load-test/output/*
|
|||||||
# Turbo
|
# Turbo
|
||||||
.turbo/
|
.turbo/
|
||||||
**/.turbo/
|
**/.turbo/
|
||||||
|
|
||||||
|
# PNPM
|
||||||
|
.pnpm-store
|
@@ -1,5 +1,5 @@
|
|||||||
NEXT_PUBLIC_BASE_PATH=""
|
NEXT_PUBLIC_BASE_PATH="/ui/v2/login"
|
||||||
ZITADEL_API_URL=http://localhost:22222
|
ZITADEL_API_URL=http://mock-zitadel:22222
|
||||||
ZITADEL_SERVICE_USER_TOKEN="yolo"
|
ZITADEL_SERVICE_USER_TOKEN="yolo"
|
||||||
EMAIL_VERIFICATION=true
|
EMAIL_VERIFICATION=true
|
||||||
DEBUG=true
|
DEBUG=true
|
||||||
|
@@ -1,54 +0,0 @@
|
|||||||
# Dockerfile for standalone ZITADEL Login UI
|
|
||||||
FROM node:18-alpine AS base
|
|
||||||
|
|
||||||
# Install dependencies only when needed
|
|
||||||
FROM base AS deps
|
|
||||||
RUN apk add --no-cache libc6-compat
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Prepare standalone and install dependencies
|
|
||||||
COPY prepare-standalone.sh package*.json ./
|
|
||||||
COPY *.standalone.* ./
|
|
||||||
RUN ./prepare-standalone.sh
|
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
|
||||||
FROM base AS builder
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Prepare standalone configs
|
|
||||||
RUN ./prepare-standalone.sh --no-install
|
|
||||||
|
|
||||||
# Build application
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
|
||||||
RUN npm run build:standalone
|
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
|
||||||
FROM base AS runner
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
ENV NODE_ENV production
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
|
||||||
RUN adduser --system --uid 1001 nextjs
|
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
|
||||||
|
|
||||||
# Set the correct permission for prerender cache
|
|
||||||
RUN mkdir .next
|
|
||||||
RUN chown nextjs:nodejs .next
|
|
||||||
|
|
||||||
# Automatically leverage output traces to reduce image size
|
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
||||||
|
|
||||||
USER nextjs
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
ENV PORT 3000
|
|
||||||
ENV HOSTNAME "0.0.0.0"
|
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
|
@@ -62,3 +62,4 @@ Database:
|
|||||||
User.Password: zitadel
|
User.Password: zitadel
|
||||||
|
|
||||||
Logstore.Access.Stdout.Enabled: true
|
Logstore.Access.Stdout.Enabled: true
|
||||||
|
Log.Formatter.Format: json
|
@@ -4,7 +4,7 @@ export default defineConfig({
|
|||||||
reporter: "list",
|
reporter: "list",
|
||||||
|
|
||||||
e2e: {
|
e2e: {
|
||||||
baseUrl: process.env.LOGIN_BASE_URL || "http://localhost:3000",
|
baseUrl: process.env.LOGIN_BASE_URL || "http://localhost:3001/ui/v2/login",
|
||||||
specPattern: "integration/**/*.cy.{js,jsx,ts,tsx}",
|
specPattern: "integration/**/*.cy.{js,jsx,ts,tsx}",
|
||||||
supportFile: "support/e2e.{js,jsx,ts,tsx}",
|
supportFile: "support/e2e.{js,jsx,ts,tsx}",
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
|
@@ -1,30 +0,0 @@
|
|||||||
services:
|
|
||||||
core-mock:
|
|
||||||
image: "${LOGIN_CORE_MOCK_TAG:-login-core-mock:local}"
|
|
||||||
container_name: integration-core-mock
|
|
||||||
ports:
|
|
||||||
- 22220:22220
|
|
||||||
- 22222:22222
|
|
||||||
|
|
||||||
login:
|
|
||||||
image: "${LOGIN_TAG:-login:local}"
|
|
||||||
container_name: integration-login
|
|
||||||
ports:
|
|
||||||
- 3001:3001
|
|
||||||
environment:
|
|
||||||
- PORT=3001
|
|
||||||
- ZITADEL_API_URL=http://core-mock:22222
|
|
||||||
- ZITADEL_SERVICE_USER_TOKEN="yolo"
|
|
||||||
- EMAIL_VERIFICATION=true
|
|
||||||
|
|
||||||
integration:
|
|
||||||
image: "${LOGIN_TEST_INTEGRATION_TAG:-login-test-integration:local}"
|
|
||||||
container_name: integration
|
|
||||||
environment:
|
|
||||||
- LOGIN_BASE_URL=http://login:3001/ui/v2/login
|
|
||||||
- CYPRESS_CORE_MOCK_STUBS_URL=http://core-mock:22220/v1/stubs
|
|
||||||
depends_on:
|
|
||||||
login:
|
|
||||||
condition: service_started
|
|
||||||
core-mock:
|
|
||||||
condition: service_started
|
|
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "login-test-integration",
|
"name": "login-test-integration",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:integration": "DISPLAY='' dotenv -e ../../apps/login/.env.test cypress",
|
"test:integration": "DISPLAY='' dotenv -e ../../apps/login/.env.test cypress",
|
||||||
"test:integration:setup": "cd .. && make login_test_integration_dev"
|
"test:integration:setup": "cd .. && make login_test_integration_dev"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
const url = Cypress.env("CORE_MOCK_STUBS_URL") || "http://localhost:22220/v1/stubs";
|
const url = Cypress.env("CORE_MOCK_STUBS_URL") || "http://mock-zitadel:22220/v1/stubs";
|
||||||
|
|
||||||
function removeStub(service: string, method: string) {
|
function removeStub(service: string, method: string) {
|
||||||
return cy.request({
|
return cy.request({
|
||||||
|
Reference in New Issue
Block a user