initial base setup #1
|
|
@ -29,4 +29,7 @@ jobs:
|
||||||
if docker compose -f docker-compose.dev-env.yml ps --status running 2>/dev/null | grep -q frontend; then
|
if docker compose -f docker-compose.dev-env.yml ps --status running 2>/dev/null | grep -q frontend; then
|
||||||
curl -sf http://localhost:3097/api/health && echo "✓ DEV Frontend-Proxy /api/health OK"
|
curl -sf http://localhost:3097/api/health && echo "✓ DEV Frontend-Proxy /api/health OK"
|
||||||
fi
|
fi
|
||||||
|
docker compose -f docker-compose.dev-env.yml exec -T backend pip install -q -r requirements-dev.txt
|
||||||
|
docker compose -f docker-compose.dev-env.yml exec -T backend python -m pytest tests -ra -vv --tb=short
|
||||||
|
echo "✓ DEV pytest OK"
|
||||||
echo "=== Kairo DEV Deploy complete ==="
|
echo "=== Kairo DEV Deploy complete ==="
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,7 @@ jobs:
|
||||||
if docker compose ps --status running 2>/dev/null | grep -q frontend; then
|
if docker compose ps --status running 2>/dev/null | grep -q frontend; then
|
||||||
curl -sf http://localhost:3004/api/health && echo "✓ PROD Frontend-Proxy /api/health OK"
|
curl -sf http://localhost:3004/api/health && echo "✓ PROD Frontend-Proxy /api/health OK"
|
||||||
fi
|
fi
|
||||||
|
docker compose exec -T backend pip install -q -r requirements-dev.txt
|
||||||
|
docker compose exec -T backend python -m pytest tests -ra -vv --tb=short
|
||||||
|
echo "✓ PROD pytest OK"
|
||||||
echo "=== Kairo PROD Deploy complete ==="
|
echo "=== Kairo PROD Deploy complete ==="
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
name: Test Suite
|
name: Test Suite
|
||||||
|
|
||||||
# push develop/main → compose-smoke (frischer Build auf dem Runner)
|
# push develop/main → nur lint + frontend-build (Deploy läuft separat)
|
||||||
# workflow_run nach Deploy → pytest/k6/playwright gegen laufende Instanz
|
# pull_request → compose-smoke auf alternativen Ports (kein Konflikt mit kairo-dev)
|
||||||
# pull_request → compose-smoke
|
# workflow_run nach Deploy → pytest/k6/playwright gegen deployte Instanz (localhost)
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [develop, main]
|
branches: [develop, main]
|
||||||
|
|
@ -14,28 +14,26 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compose-smoke:
|
compose-smoke:
|
||||||
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
# Nicht bei push: Deploy nutzt dieselben Standard-Ports auf dem Pi.
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
|
COMPOSE_PROJECT_NAME: kairo-ci-smoke
|
||||||
DB_PASSWORD: ci_smoke_password
|
DB_PASSWORD: ci_smoke_password
|
||||||
|
KAIRO_BACKEND_PORT: 18197
|
||||||
|
KAIRO_FRONTEND_PORT: 13197
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Compose Stack bauen und testen
|
- name: Compose Stack bauen und testen (isolierte CI-Ports)
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
if [ "${{ github.ref_name }}" = "main" ]; then
|
COMPOSE="docker-compose.dev-env.yml"
|
||||||
COMPOSE="docker-compose.yml"
|
API_PORT="${KAIRO_BACKEND_PORT}"
|
||||||
API_PORT=8004
|
UI_PORT="${KAIRO_FRONTEND_PORT}"
|
||||||
UI_PORT=3004
|
|
||||||
else
|
|
||||||
COMPOSE="docker-compose.dev-env.yml"
|
|
||||||
API_PORT=8097
|
|
||||||
UI_PORT=3097
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Smoke: $COMPOSE ==="
|
echo "=== Smoke: $COMPOSE (Projekt $COMPOSE_PROJECT_NAME, API $API_PORT) ==="
|
||||||
docker compose -f "$COMPOSE" up -d --build --wait
|
docker compose -f "$COMPOSE" up -d --build --wait
|
||||||
|
|
||||||
curl -sf "http://localhost:${API_PORT}/api/health" | tee /tmp/health-api.json
|
curl -sf "http://localhost:${API_PORT}/api/health" | tee /tmp/health-api.json
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,7 @@ services:
|
||||||
POSTGRES_PASSWORD: "${DB_PASSWORD:-dev_password}"
|
POSTGRES_PASSWORD: "${DB_PASSWORD:-dev_password}"
|
||||||
volumes:
|
volumes:
|
||||||
- dev-kairo-db-data:/var/lib/postgresql/data
|
- dev-kairo-db-data:/var/lib/postgresql/data
|
||||||
ports:
|
# Kein Host-Port: DB nur im Compose-Netz (vermeidet Konflikte mit kairo-dev + CI)
|
||||||
- "5437:5432"
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-kairo_dev} -d ${DB_NAME:-kairo_dev}"]
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-kairo_dev} -d ${DB_NAME:-kairo_dev}"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
|
|
@ -35,7 +34,7 @@ services:
|
||||||
ALLOWED_ORIGINS: "${ALLOWED_ORIGINS:-https://dev.kairo.jinkendo.de,http://192.168.2.49:3097,http://localhost:3097}"
|
ALLOWED_ORIGINS: "${ALLOWED_ORIGINS:-https://dev.kairo.jinkendo.de,http://192.168.2.49:3097,http://localhost:3097}"
|
||||||
ENVIRONMENT: "${ENVIRONMENT:-development}"
|
ENVIRONMENT: "${ENVIRONMENT:-development}"
|
||||||
ports:
|
ports:
|
||||||
- "8097:8000"
|
- "${KAIRO_BACKEND_PORT:-8097}:8000"
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -62,7 +61,7 @@ services:
|
||||||
args:
|
args:
|
||||||
VITE_API_URL: ""
|
VITE_API_URL: ""
|
||||||
ports:
|
ports:
|
||||||
- "3097:80"
|
- "${KAIRO_FRONTEND_PORT:-3097}:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
backend:
|
backend:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ services:
|
||||||
ALLOWED_ORIGINS: "${ALLOWED_ORIGINS:-https://kairo.jinkendo.de}"
|
ALLOWED_ORIGINS: "${ALLOWED_ORIGINS:-https://kairo.jinkendo.de}"
|
||||||
ENVIRONMENT: "${ENVIRONMENT:-production}"
|
ENVIRONMENT: "${ENVIRONMENT:-production}"
|
||||||
ports:
|
ports:
|
||||||
- "8004:8000"
|
- "${KAIRO_BACKEND_PORT:-8004}:8000"
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -64,7 +64,7 @@ services:
|
||||||
VITE_API_URL: ""
|
VITE_API_URL: ""
|
||||||
container_name: kairo-ui
|
container_name: kairo-ui
|
||||||
ports:
|
ports:
|
||||||
- "3004:80"
|
- "${KAIRO_FRONTEND_PORT:-3004}:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
backend:
|
backend:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
| **Server-Verzeichnis** | `/home/lars/docker/kairo` | `/home/lars/docker/kairo-dev` |
|
| **Server-Verzeichnis** | `/home/lars/docker/kairo` | `/home/lars/docker/kairo-dev` |
|
||||||
| **Frontend-Port** | 3004 | 3097 |
|
| **Frontend-Port** | 3004 | 3097 |
|
||||||
| **Backend-Port** | 8004 | 8097 |
|
| **Backend-Port** | 8004 | 8097 |
|
||||||
| **PostgreSQL (localhost)** | 5436 | 5437 |
|
| **PostgreSQL** | nur im Container-Netz (Prod optional localhost:5436) | nur im Container-Netz |
|
||||||
| **Domain** | kairo.jinkendo.de | dev.kairo.jinkendo.de |
|
| **Domain** | kairo.jinkendo.de | dev.kairo.jinkendo.de |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user