-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
130 lines (97 loc) · 2.95 KB
/
Copy pathjustfile
File metadata and controls
130 lines (97 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# dati-semantic-admin — task runner
# https://just.systems (richiede `just` installato)
# Default: lista i comandi disponibili
default:
@just --list
# --- Sviluppo ---
# Avvia Keycloak locale (in background) e attende che sia ready
kc-up:
docker compose up -d keycloak
@echo "Attendo Keycloak su http://localhost:8082..."
@until curl -sf http://localhost:8082/realms/ndc/.well-known/openid-configuration -o /dev/null 2>/dev/null; do sleep 1; done
@echo "Keycloak ready"
# Pipeline completa: avvia Keycloak e build in parallelo, poi bootRun.
# Sfrutta la build cache Gradle (org.gradle.caching=true) e l'inputs/outputs
# del task npmBuild per saltare lavori già fatti.
run:
#!/usr/bin/env bash
set -euo pipefail
docker compose up -d keycloak
echo "[parallel] gradle build + attesa Keycloak ready"
./gradlew --quiet build &
BUILD_PID=$!
(
until curl -sf http://localhost:8082/realms/ndc/.well-known/openid-configuration -o /dev/null 2>/dev/null; do
sleep 1
done
echo "[keycloak] ready"
) &
WAIT_PID=$!
# Aspetta entrambi; se uno fallisce, fa fail tutto.
wait $BUILD_PID || { echo "[build] FAILED"; kill $WAIT_PID 2>/dev/null || true; exit 1; }
echo "[build] done"
wait $WAIT_PID
SPRING_PROFILES_ACTIVE=local ./gradlew bootRun
# Stop Keycloak locale
kc-down:
docker compose down
# Tail log Keycloak
kc-logs:
docker compose logs -f keycloak
# Apri la admin console di Keycloak (user/pass: admin/admin)
kc-console:
@echo "Keycloak admin: http://localhost:8082/admin"
@echo " user: admin"
@echo " pass: admin"
# Avvia backend Spring (profilo local). Richiede Keycloak su 8082 e BE NDC su 8081.
dev:
SPRING_PROFILES_ACTIVE=local ./gradlew bootRun
# Avvia dev server Vite (hot reload). In parallelo con `just dev`.
fe-dev:
cd frontend && npm run dev
# --- Build ---
# Build completo: FE + jar
build:
./gradlew build
# Build solo del jar (senza FE, usa l'ultimo build esistente)
build-jar:
./gradlew bootJar -x copyFrontendDist
# Build solo del FE
fe-build:
./gradlew npmBuild
# Clean
clean:
./gradlew clean
# --- Test ---
# Test backend
test:
./gradlew test
# Lint completo (FE + BE)
lint: fe-lint be-lint
# Format completo (FE + BE) - applica modifiche
format: fe-format be-format
# Lint solo frontend
fe-lint:
cd frontend && npm run lint
# Lint solo backend
be-lint:
./gradlew spotlessCheck
# Format solo frontend
fe-format:
cd frontend && npm run format
# Format solo backend
be-format:
./gradlew spotlessApply
# --- Container ---
# Build immagine Docker locale
image:
docker build -t dati-semantic-admin:dev .
# Run dell'immagine appena buildata
image-run:
docker run --rm -p 8080:8080 --network host \
-e SPRING_PROFILES_ACTIVE=local \
dati-semantic-admin:dev
# --- Setup ---
# Installa dipendenze npm (eseguito da gradle automaticamente, qui per debug)
fe-install:
cd frontend && npm install