ci: docker-admin-ui job (Node build → nginx serving)

Build только при изменениях ordinis-admin-ui/** или каждом push в main.
Использует тот же DinD pattern, push в repo.nstart.cloud/terravault/ordinis-admin-ui.
This commit is contained in:
Александр Зимин
2026-05-04 01:05:20 +03:00
parent 1eba2ee59b
commit daad2b6349
2 changed files with 37 additions and 25 deletions
+14
View File
@@ -126,6 +126,20 @@ docker-migrations:
script:
- *publish_script
# Admin UI — независимый от Maven (Node build), но публикуется в тот же registry.
docker-admin-ui:
extends: .docker_base
needs: []
variables:
SVC: ordinis-admin-ui
DOCKERFILE: ordinis-admin-ui/Dockerfile
BUILD_CONTEXT: ordinis-admin-ui/
script:
- *publish_script
rules:
- changes: ["ordinis-admin-ui/**/*"]
- if: '$CI_COMMIT_BRANCH == "main"'
# ─── TRIGGER DEPLOY (downstream pipeline) ──────
# GitLab quirk: variables: в trigger job НЕ интерполируются от upstream global
# variables напрямую — `$IMAGE_TAG` передавался как литерал. Workaround:
+23 -25
View File
@@ -2,35 +2,33 @@ server {
listen 80;
server_name _;
# SPA history fallback
# Real client IP behind ingress-nginx.
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
# SPA history fallback.
root /usr/share/nginx/html;
index index.html;
# GET /api/v1/dictionaries и /api/v1/<name>/records → read-api.
# POST/PUT/PATCH/DELETE на тех же путях → writer (ordinis-app).
# Method-based routing через map.
location /api/v1/ {
set $backend "ordinis-read-api";
if ($request_method ~ ^(POST|PUT|PATCH|DELETE)$) {
set $backend "ordinis-app";
}
proxy_pass http://$backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
}
location / {
try_files $uri $uri/ /index.html;
}
# API proxy в read-api/writer (через k8s service DNS).
# Реальный endpoint задаётся через env-template или ENV в pod, в v1
# просто проксируем на ordinis-read-api (только GET) и ordinis-app (write).
location /api/v1/dictionaries {
# POST/PUT идут в writer, GET — в read-api. Простое разделение по methods:
if ($request_method ~ ^(POST|PUT|PATCH|DELETE)$) {
proxy_pass http://ordinis-app:80;
}
proxy_pass http://ordinis-read-api:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_request_headers on;
}
location ~ ^/api/v1/[^/]+/records {
if ($request_method ~ ^(POST|PUT|PATCH|DELETE)$) {
proxy_pass http://ordinis-app:80;
}
proxy_pass http://ordinis-read-api:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass_request_headers on;
}
}