Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f80388351f | |||
| 9332f77959 | |||
| 6353e0c7b3 | |||
| 1161717f74 | |||
| b50f928318 | |||
| 256858f169 | |||
| fcab8b4a25 | |||
| fa62efc2e3 | |||
| 2fef8bf255 | |||
| 7737dde2ed | |||
| 3a4e8a2f5a |
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
description: Start the MinAttest project (Backend + Frontend)
|
|
||||||
---
|
|
||||||
|
|
||||||
# Start MinAttest
|
|
||||||
|
|
||||||
This workflow starts the backend (with database) and the frontend.
|
|
||||||
|
|
||||||
## 1. Start Backend (API + Database)
|
|
||||||
The backend uses .NET Aspire to orchestrate the API and the PostgreSQL container.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
// turbo
|
|
||||||
dotnet run --project backend/MinAttest.AppHost/MinAttest.AppHost.csproj
|
|
||||||
```
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> Check the console output for the API URL (e.g., `https://localhost:7172` or similar).
|
|
||||||
> You may need to update `frontend/minattest-app/vite.config.ts` if the port doesn't match `10001`.
|
|
||||||
|
|
||||||
## 2. Start Frontend
|
|
||||||
Open a new terminal for the frontend.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd frontend/minattest-app
|
|
||||||
npm install
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> The frontend will be available at `http://localhost:5173`.
|
|
||||||
+51
-15
@@ -4,60 +4,96 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- develop
|
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: gitea.theriise.net/steinhelge
|
||||||
|
REGISTRY_HOST: gitea.theriise.net
|
||||||
|
REGISTRY_NAMESPACE: steinhelge
|
||||||
|
IMAGE_NAME: minattest
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
wake-zorin:
|
||||||
|
name: Wake Zorin
|
||||||
|
runs-on: waker # t610-waker-runneren med label "waker"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Wake Zorin via WOL
|
||||||
|
run: /home/steinhelge/wake-zorin.sh
|
||||||
|
|
||||||
|
- name: Vent på at Zorin våkner
|
||||||
|
run: sleep 10
|
||||||
|
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
|
||||||
env:
|
|
||||||
# Denne gir f.eks:
|
|
||||||
# main → latest
|
|
||||||
# develop → dev
|
|
||||||
# dev → dev
|
|
||||||
TAG: ${{ github.ref_name == 'main' && 'latest' || 'dev' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Finn ut hvilken tag vi skal bruke
|
||||||
|
- name: Set image tag
|
||||||
|
run: |
|
||||||
|
# Gitea prøver å være kompatibel med GitHub Actions
|
||||||
|
# Noen ganger er GITHUB_REF_NAME bare 'main', andre ganger 'refs/heads/main'
|
||||||
|
REF="${GITHUB_REF_NAME:-$GITHUB_REF}"
|
||||||
|
REF="${REF#refs/heads/}"
|
||||||
|
|
||||||
|
if [ "$REF" = "main" ]; then
|
||||||
|
TAG="latest"
|
||||||
|
elif [ "$REF" = "dev" ]; then
|
||||||
|
TAG="dev"
|
||||||
|
else
|
||||||
|
# fallback: bruk branchnavnet som tag, men uten skråstreker
|
||||||
|
TAG="$(echo "$REF" | tr '/' '-')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Bygger med TAG=$TAG"
|
||||||
|
echo "TAG=$TAG" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.theriise.net -u steinhelge --password-stdin
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login $REGISTRY -u steinhelge --password-stdin
|
||||||
|
|
||||||
# ---------- Frontend ----------
|
# ---------- Frontend ----------
|
||||||
- name: Build Frontend (${{ env.TAG }})
|
- name: Build Frontend (${{ env.TAG }})
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
-t gitea.theriise.net/steinhelge/minattest-frontend:${TAG} \
|
-t $REGISTRY/minattest-frontend:${TAG} \
|
||||||
-f frontend/minattest-app/Dockerfile \
|
-f frontend/minattest-app/Dockerfile \
|
||||||
frontend/minattest-app
|
frontend/minattest-app
|
||||||
|
|
||||||
- name: Push Frontend (${{ env.TAG }})
|
- name: Push Frontend (${{ env.TAG }})
|
||||||
run: |
|
run: |
|
||||||
docker push gitea.theriise.net/steinhelge/minattest-frontend:${TAG}
|
docker push $REGISTRY/minattest-frontend:${TAG}
|
||||||
|
|
||||||
# ---------- Backend API ----------
|
# ---------- Backend API ----------
|
||||||
- name: Build API (${{ env.TAG }})
|
- name: Build API (${{ env.TAG }})
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
-t gitea.theriise.net/steinhelge/minattest-api:${TAG} \
|
-t $REGISTRY/minattest-api:${TAG} \
|
||||||
-f backend/Dockerfile \
|
-f backend/Dockerfile \
|
||||||
backend
|
backend
|
||||||
|
|
||||||
- name: Push API (${{ env.TAG }})
|
- name: Push API (${{ env.TAG }})
|
||||||
run: |
|
run: |
|
||||||
docker push gitea.theriise.net/steinhelge/minattest-api:${TAG}
|
docker push $REGISTRY/minattest-api:${TAG}
|
||||||
|
|
||||||
# ---------- App Host / BFF ----------
|
# ---------- App Host / BFF ----------
|
||||||
- name: Build App Host (${{ env.TAG }})
|
- name: Build App Host (${{ env.TAG }})
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
-t gitea.theriise.net/steinhelge/minattest-app-host:${TAG} \
|
-t $REGISTRY/minattest-app-host:${TAG} \
|
||||||
-f frontend/minattest-app-host/Dockerfile \
|
-f frontend/minattest-app-host/Dockerfile \
|
||||||
frontend/minattest-app-host
|
frontend/minattest-app-host
|
||||||
|
|
||||||
- name: Push App Host (${{ env.TAG }})
|
- name: Push App Host (${{ env.TAG }})
|
||||||
run: |
|
run: |
|
||||||
docker push gitea.theriise.net/steinhelge/minattest-app-host:${TAG}
|
docker push $REGISTRY/minattest-app-host:${TAG}
|
||||||
|
|
||||||
|
- name: Deploy (docker compose pull + up)
|
||||||
|
run: |
|
||||||
|
cd /srv/minattest # ← Endre denne pathen hvis compose ligger et annet sted
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
{
|
{
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"Using": [ "Serilog.Sinks.Console" ],
|
"Using": [ "Serilog.Sinks.Console" ],
|
||||||
"MinimumLevel": {
|
"MinimumLevel": {
|
||||||
"Default": "Verbose",
|
"Default": "Verbose",
|
||||||
"Override": {
|
"Override": {
|
||||||
"Microsoft": "Information",
|
"Microsoft": "Information",
|
||||||
"System": "Information"
|
"System": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"WriteTo": [
|
"WriteTo": [
|
||||||
{
|
{
|
||||||
"Name": "Console",
|
"Name": "Console",
|
||||||
"Args": {
|
"Args": {
|
||||||
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console",
|
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console",
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
|
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Enrich": [ "FromLogContext" ]
|
"Enrich": [ "FromLogContext" ]
|
||||||
},
|
},
|
||||||
"ReverseProxy": {
|
"ReverseProxy": {
|
||||||
"Routes": {
|
"Routes": {
|
||||||
"userApiRoute": {
|
"userApiRoute": {
|
||||||
"ClusterId": "clusterUser",
|
"ClusterId": "clusterUser",
|
||||||
"Match": {
|
"Match": {
|
||||||
"Path": "/api/{**catch-all}"
|
"Path": "/api/{**catch-all}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Clusters": {
|
"Clusters": {
|
||||||
"clusterUser": {
|
"clusterUser": {
|
||||||
"Destinations": {
|
"Destinations": {
|
||||||
"destination1": {
|
"destination1": {
|
||||||
"Address": "https://localhost:7172/"
|
"Address": "http://backend-api:8080/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*"
|
||||||
}
|
}
|
||||||
@@ -1,42 +1,42 @@
|
|||||||
{
|
{
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"Using": [ "Serilog.Sinks.Console" ],
|
"Using": [ "Serilog.Sinks.Console" ],
|
||||||
"MinimumLevel": {
|
"MinimumLevel": {
|
||||||
"Default": "Verbose",
|
"Default": "Verbose",
|
||||||
"Override": {
|
"Override": {
|
||||||
"Microsoft": "Information",
|
"Microsoft": "Information",
|
||||||
"System": "Information"
|
"System": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"WriteTo": [
|
"WriteTo": [
|
||||||
{
|
{
|
||||||
"Name": "Console",
|
"Name": "Console",
|
||||||
"Args": {
|
"Args": {
|
||||||
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console",
|
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console",
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
|
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Enrich": [ "FromLogContext" ]
|
"Enrich": [ "FromLogContext" ]
|
||||||
},
|
},
|
||||||
"ReverseProxy": {
|
"ReverseProxy": {
|
||||||
"Routes": {
|
"Routes": {
|
||||||
"userApiRoute": {
|
"userApiRoute": {
|
||||||
"ClusterId": "clusterUser",
|
"ClusterId": "clusterUser",
|
||||||
"Match": {
|
"Match": {
|
||||||
"Path": "/api/{**catch-all}"
|
"Path": "/api/{**catch-all}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Clusters": {
|
"Clusters": {
|
||||||
"clusterUser": {
|
"clusterUser": {
|
||||||
"Destinations": {
|
"Destinations": {
|
||||||
"destination1": {
|
"destination1": {
|
||||||
"Address": "https://localhost:7172/"
|
"Address": "http://backend-api:8080/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*"
|
||||||
}
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
# Start MinAttest Development Environment (Windows)
|
|
||||||
|
|
||||||
Write-Host "🚀 Starting MinAttest Development Environment..." -ForegroundColor Cyan
|
|
||||||
|
|
||||||
# Function to check if a port is in use
|
|
||||||
function Test-PortInUse {
|
|
||||||
param (
|
|
||||||
[int]$Port
|
|
||||||
)
|
|
||||||
$tcpConnection = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue
|
|
||||||
return $tcpConnection -ne $null
|
|
||||||
}
|
|
||||||
|
|
||||||
# 1. Start Backend (Aspire AppHost) - Port 7172
|
|
||||||
if (Test-PortInUse -Port 7172) {
|
|
||||||
Write-Host "✅ Backend (API) is already running on port 7172." -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Host "🚀 Starting Backend (Aspire AppHost)..." -ForegroundColor Yellow
|
|
||||||
Start-Process -FilePath "dotnet" -ArgumentList "run --project backend/MinAttest.AppHost/MinAttest.AppHost.csproj" -NoNewWindow
|
|
||||||
|
|
||||||
# Wait loop (simple pause as checking port immediately might be flaky during startup)
|
|
||||||
Start-Sleep -Seconds 5
|
|
||||||
}
|
|
||||||
|
|
||||||
# 2. Start BFF (Reverse Proxy) - Port 10001
|
|
||||||
if (Test-PortInUse -Port 10001) {
|
|
||||||
Write-Host "✅ BFF is already running on port 10001." -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Host "🚀 Starting BFF..." -ForegroundColor Yellow
|
|
||||||
Start-Process -FilePath "dotnet" -ArgumentList "run --project frontend/minattest-app-host/minattest-app-host.csproj" -NoNewWindow
|
|
||||||
Start-Sleep -Seconds 2
|
|
||||||
}
|
|
||||||
|
|
||||||
# 3. Start Frontend (Vite) - Port 5173
|
|
||||||
if (Test-PortInUse -Port 5173) {
|
|
||||||
Write-Host "✅ Frontend is already running on port 5173." -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Host "🚀 Starting Frontend..." -ForegroundColor Yellow
|
|
||||||
Set-Location "frontend/minattest-app"
|
|
||||||
|
|
||||||
if (-not (Test-Path "node_modules")) {
|
|
||||||
Write-Host "📦 Installing dependencies..." -ForegroundColor Yellow
|
|
||||||
Start-Process -FilePath "npm" -ArgumentList "install" -NoNewWindow -Wait
|
|
||||||
}
|
|
||||||
|
|
||||||
Start-Process -FilePath "npm" -ArgumentList "run dev" -NoNewWindow
|
|
||||||
Set-Location "../.."
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "✨ All services are starting up!" -ForegroundColor Cyan
|
|
||||||
Write-Host " - Backend API: https://localhost:7172"
|
|
||||||
Write-Host " - BFF: https://localhost:10001"
|
|
||||||
Write-Host " - Frontend: http://localhost:5173"
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Colors
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
BLUE='\033[0;34m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
echo -e "${BLUE}🚀 Starting MinAttest Development Environment...${NC}"
|
|
||||||
|
|
||||||
# Function to check if a port is in use
|
|
||||||
is_port_in_use() {
|
|
||||||
lsof -i :$1 -sTCP:LISTEN >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
# 1. Start Backend (Aspire AppHost) - Port 7172 (API)
|
|
||||||
# Note: AppHost also starts Postgres
|
|
||||||
if is_port_in_use 7172; then
|
|
||||||
echo -e "${GREEN}✅ Backend (API) is already running on port 7172.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${YELLOW}🚀 Starting Backend (Aspire AppHost)...${NC}"
|
|
||||||
dotnet run --project backend/MinAttest.AppHost/MinAttest.AppHost.csproj > backend.log 2>&1 &
|
|
||||||
BACKEND_PID=$!
|
|
||||||
echo " Started with PID $BACKEND_PID. Logs: backend.log"
|
|
||||||
|
|
||||||
# Wait for port to be ready (optional, but good for ordering)
|
|
||||||
echo " Waiting for API to be ready on port 7172..."
|
|
||||||
while ! is_port_in_use 7172; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
echo -e "${GREEN} Backend is ready!${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 2. Start BFF (Reverse Proxy) - Port 10001
|
|
||||||
if is_port_in_use 10001; then
|
|
||||||
echo -e "${GREEN}✅ BFF is already running on port 10001.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${YELLOW}🚀 Starting BFF...${NC}"
|
|
||||||
dotnet run --project frontend/minattest-app-host/minattest-app-host.csproj > bff.log 2>&1 &
|
|
||||||
BFF_PID=$!
|
|
||||||
echo " Started with PID $BFF_PID. Logs: bff.log"
|
|
||||||
|
|
||||||
echo " Waiting for BFF to be ready on port 10001..."
|
|
||||||
while ! is_port_in_use 10001; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
echo -e "${GREEN} BFF is ready!${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 3. Start Frontend (Vite) - Port 5173
|
|
||||||
if is_port_in_use 5173; then
|
|
||||||
echo -e "${GREEN}✅ Frontend is already running on port 5173.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${YELLOW}🚀 Starting Frontend...${NC}"
|
|
||||||
cd frontend/minattest-app
|
|
||||||
|
|
||||||
if [ ! -d "node_modules" ]; then
|
|
||||||
echo -e "${YELLOW}📦 Installing dependencies...${NC}"
|
|
||||||
npm install
|
|
||||||
fi
|
|
||||||
|
|
||||||
npm run dev > ../../frontend.log 2>&1 &
|
|
||||||
FRONTEND_PID=$!
|
|
||||||
cd ../..
|
|
||||||
echo " Started with PID $FRONTEND_PID. Logs: frontend.log"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "${BLUE}✨ All services are up and running!${NC}"
|
|
||||||
echo -e " - Backend API: https://localhost:7172"
|
|
||||||
echo -e " - BFF: https://localhost:10001"
|
|
||||||
echo -e " - Frontend: http://localhost:5173"
|
|
||||||
echo -e " - Aspire Dash: (Check backend.log for port)"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
# Stop MinAttest Development Environment (Windows)
|
|
||||||
|
|
||||||
Write-Host "🛑 Stopping MinAttest Development Environment..." -ForegroundColor Red
|
|
||||||
|
|
||||||
# Function to kill process on a port
|
|
||||||
function Stop-PortProcess {
|
|
||||||
param (
|
|
||||||
[int]$Port,
|
|
||||||
[string]$Name
|
|
||||||
)
|
|
||||||
$tcpConnection = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
if ($tcpConnection) {
|
|
||||||
$pid = $tcpConnection.OwningProcess
|
|
||||||
Write-Host " Killing $Name (Port $Port, PID $pid)..." -ForegroundColor Yellow
|
|
||||||
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
|
|
||||||
Write-Host " $Name stopped." -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Host " $Name is not running (Port $Port free)."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# 1. Stop Backend (API) - Port 7172
|
|
||||||
Stop-PortProcess -Port 7172 -Name "Backend (API)"
|
|
||||||
|
|
||||||
# 2. Stop BFF - Port 10001
|
|
||||||
Stop-PortProcess -Port 10001 -Name "BFF"
|
|
||||||
|
|
||||||
# 3. Stop Frontend - Port 5173
|
|
||||||
Stop-PortProcess -Port 5173 -Name "Frontend"
|
|
||||||
|
|
||||||
# 4. Stop Aspire Dashboard & Resources (Cleanup)
|
|
||||||
Write-Host " Cleaning up Aspire ports..." -ForegroundColor Yellow
|
|
||||||
Stop-PortProcess -Port 17105 -Name "Aspire AppHost (HTTPS)"
|
|
||||||
Stop-PortProcess -Port 15182 -Name "Aspire AppHost (HTTP)"
|
|
||||||
Stop-PortProcess -Port 21157 -Name "Aspire Dashboard (OTLP)"
|
|
||||||
Stop-PortProcess -Port 22256 -Name "Aspire Resource Service"
|
|
||||||
|
|
||||||
Write-Host "✨ All services stopped." -ForegroundColor Green
|
|
||||||
-41
@@ -1,41 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Colors
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
RED='\033[0;31m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
echo -e "${RED}🛑 Stopping MinAttest Development Environment...${NC}"
|
|
||||||
|
|
||||||
# Function to kill process on a port
|
|
||||||
kill_port() {
|
|
||||||
PORT=$1
|
|
||||||
NAME=$2
|
|
||||||
PID=$(lsof -ti:$PORT)
|
|
||||||
if [ -n "$PID" ]; then
|
|
||||||
echo -e "${YELLOW} Killing $NAME (Port $PORT, PID $PID)...${NC}"
|
|
||||||
kill -9 $PID
|
|
||||||
echo -e "${GREEN} $NAME stopped.${NC}"
|
|
||||||
else
|
|
||||||
echo -e " $NAME is not running (Port $PORT free)."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# 1. Stop Backend (API) - Port 7172
|
|
||||||
kill_port 7172 "Backend (API)"
|
|
||||||
|
|
||||||
# 2. Stop BFF - Port 10001
|
|
||||||
kill_port 10001 "BFF"
|
|
||||||
|
|
||||||
# 3. Stop Frontend - Port 5173
|
|
||||||
kill_port 5173 "Frontend"
|
|
||||||
|
|
||||||
# 4. Stop Aspire Dashboard & Resources (Cleanup)
|
|
||||||
echo -e "${YELLOW} Cleaning up Aspire ports...${NC}"
|
|
||||||
kill_port 17105 "Aspire AppHost (HTTPS)"
|
|
||||||
kill_port 15182 "Aspire AppHost (HTTP)"
|
|
||||||
kill_port 21157 "Aspire Dashboard (OTLP)"
|
|
||||||
kill_port 22256 "Aspire Resource Service"
|
|
||||||
|
|
||||||
echo -e "${GREEN}✨ All services stopped.${NC}"
|
|
||||||
Reference in New Issue
Block a user