Compare commits
2 Commits
7a3e2167c2
...
83441b6c69
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83441b6c69 | ||
|
|
283ca4f148 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -61,6 +61,7 @@ jobs:
|
|||||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
|
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
|
||||||
|
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
||||||
QA_ADMIN_PORT: ${{ vars.QA_ADMIN_PORT }}
|
QA_ADMIN_PORT: ${{ vars.QA_ADMIN_PORT }}
|
||||||
steps:
|
steps:
|
||||||
# actions/checkout@v4 is a Node-based action; this runner has no node
|
# actions/checkout@v4 is a Node-based action; this runner has no node
|
||||||
@@ -81,6 +82,7 @@ jobs:
|
|||||||
runs-on: [self-hosted, qa]
|
runs-on: [self-hosted, qa]
|
||||||
env:
|
env:
|
||||||
QA_ADMIN_PORT: ${{ vars.QA_ADMIN_PORT }}
|
QA_ADMIN_PORT: ${{ vars.QA_ADMIN_PORT }}
|
||||||
|
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
||||||
steps:
|
steps:
|
||||||
# actions/checkout@v4 is a Node-based action; this runner has no node
|
# actions/checkout@v4 is a Node-based action; this runner has no node
|
||||||
# in PATH, so checkout plain git instead of via marketplace action.
|
# in PATH, so checkout plain git instead of via marketplace action.
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ REGISTRY_TOKEN=changeme
|
|||||||
|
|
||||||
# QA environment
|
# QA environment
|
||||||
JWT_SECRET_KEY=change-this-to-a-random-32-plus-char-secret
|
JWT_SECRET_KEY=change-this-to-a-random-32-plus-char-secret
|
||||||
|
POSTGRES_PASSWORD=change-this-to-a-random-password
|
||||||
QA_ADMIN_PORT=3001
|
QA_ADMIN_PORT=3001
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: miccheck
|
POSTGRES_DB: miccheck
|
||||||
POSTGRES_USER: miccheck
|
POSTGRES_USER: miccheck
|
||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
||||||
ports:
|
ports:
|
||||||
- "${DB_BIND_HOST:-127.0.0.1}:55432:5432"
|
- "${DB_BIND_HOST:-127.0.0.1}:55432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -31,7 +31,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
ASPNETCORE_ENVIRONMENT: Development
|
ASPNETCORE_ENVIRONMENT: Development
|
||||||
ASPNETCORE_URLS: http://+:8080
|
ASPNETCORE_URLS: http://+:8080
|
||||||
ConnectionStrings__miccheck: "Host=db;Database=miccheck;Username=miccheck;Password=password"
|
ConnectionStrings__miccheck: "Host=db;Database=miccheck;Username=miccheck;Password=${POSTGRES_PASSWORD}"
|
||||||
Jwt__SecretKey: ${JWT_SECRET_KEY}
|
Jwt__SecretKey: ${JWT_SECRET_KEY}
|
||||||
Jwt__Issuer: MicCheck
|
Jwt__Issuer: MicCheck
|
||||||
Jwt__Audience: MicCheck
|
Jwt__Audience: MicCheck
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
services:
|
|
||||||
|
|
||||||
# ── PostgreSQL ───────────────────────────────────────────────────────────────
|
|
||||||
db:
|
|
||||||
image: postgres:16-alpine
|
|
||||||
environment:
|
|
||||||
POSTGRES_DB: miccheck
|
|
||||||
POSTGRES_USER: miccheck
|
|
||||||
POSTGRES_PASSWORD: password
|
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
volumes:
|
|
||||||
- postgres_data:/var/lib/postgresql/data
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U miccheck -d miccheck"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
|
|
||||||
# ── .NET API ─────────────────────────────────────────────────────────────────
|
|
||||||
api:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: src/api/MicCheck.Api/Dockerfile
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
volumes:
|
|
||||||
- ./src/api/MicCheck.Api/publish:/app
|
|
||||||
environment:
|
|
||||||
ASPNETCORE_ENVIRONMENT: Development
|
|
||||||
ASPNETCORE_URLS: http://+:8080
|
|
||||||
ConnectionStrings__DefaultConnection: "Host=db;Database=miccheck;Username=miccheck;Password=password"
|
|
||||||
Jwt__SecretKey: "miccheck-dev-secret-key-change-in-production!!"
|
|
||||||
Jwt__Issuer: MicCheck
|
|
||||||
Jwt__Audience: MicCheck
|
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/api/v1/health 2>/dev/null || exit 0"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
start_period: 20s
|
|
||||||
|
|
||||||
# ── Vue Admin Site (nginx) ───────────────────────────────────────────────────
|
|
||||||
admin:
|
|
||||||
build:
|
|
||||||
context: src/admin
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
ports:
|
|
||||||
- "3000:80"
|
|
||||||
volumes:
|
|
||||||
- ./src/admin/dist:/usr/share/nginx/html
|
|
||||||
depends_on:
|
|
||||||
api:
|
|
||||||
condition: service_started
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
@@ -11,6 +11,7 @@ registry_login
|
|||||||
|
|
||||||
export API_IMAGE ADMIN_IMAGE
|
export API_IMAGE ADMIN_IMAGE
|
||||||
export JWT_SECRET_KEY="${JWT_SECRET_KEY:?JWT_SECRET_KEY env var is required}"
|
export JWT_SECRET_KEY="${JWT_SECRET_KEY:?JWT_SECRET_KEY env var is required}"
|
||||||
|
export POSTGRES_PASSWORD="${POSTGRES_PASSWORD:?POSTGRES_PASSWORD env var is required}"
|
||||||
export QA_ADMIN_PORT="${QA_ADMIN_PORT:-3001}"
|
export QA_ADMIN_PORT="${QA_ADMIN_PORT:-3001}"
|
||||||
|
|
||||||
# Bind narrowly to docker's bridge gateway IP rather than 0.0.0.0: reachable
|
# Bind narrowly to docker's bridge gateway IP rather than 0.0.0.0: reachable
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ BASE_URL="http://${CI_HOST}:${QA_ADMIN_PORT}"
|
|||||||
log "Resolved docker host as $CI_HOST for reaching the QA stack's published ports"
|
log "Resolved docker host as $CI_HOST for reaching the QA stack's published ports"
|
||||||
|
|
||||||
export MICCHECK_API_BASE_URL="$BASE_URL"
|
export MICCHECK_API_BASE_URL="$BASE_URL"
|
||||||
export MICCHECK_DB_CONNECTION_STRING="${MICCHECK_DB_CONNECTION_STRING:-Host=$CI_HOST;Port=55432;Database=miccheck;Username=miccheck;Password=password}"
|
export MICCHECK_DB_CONNECTION_STRING="${MICCHECK_DB_CONNECTION_STRING:-Host=$CI_HOST;Port=55432;Database=miccheck;Username=miccheck;Password=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD env var is required}}"
|
||||||
|
|
||||||
log "Running API integration suite against $BASE_URL"
|
log "Running API integration suite against $BASE_URL"
|
||||||
dotnet test tests/api/MicCheck.Api.Tests.Integration/MicCheck.Api.Tests.Integration.csproj -c Release --logger trx
|
dotnet test tests/api/MicCheck.Api.Tests.Integration/MicCheck.Api.Tests.Integration.csproj -c Release --logger trx
|
||||||
|
|||||||
Reference in New Issue
Block a user