Remove manual password hashing and web.yml setup in favor of automated generation. Add scripts for both Unix and Windows to create `monitoring/web.yml` using credentials from `.env`. This improves maintainability and reduces manual intervention during setup and configuration.
50 lines
1.2 KiB
PowerShell
50 lines
1.2 KiB
PowerShell
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
# Load shared utilities
|
|
$utilsPath = Join-Path $PSScriptRoot '..\lib\utils.ps1'
|
|
. $utilsPath
|
|
|
|
.\scripts\Windows\starter.ps1
|
|
if ($LASTEXITCODE -ne 0) {
|
|
exit $LASTEXITCODE
|
|
}
|
|
|
|
if (-not (Test-Path '.env'))
|
|
{
|
|
Write-Warning-Custom ".env file not found. Exiting without running Docker steps."
|
|
exit 0
|
|
}
|
|
|
|
# Check system requirements
|
|
if (-not (Test-SystemRequirements -MinCpu 4 -MinRamGB 6 -MinDiskGB 20))
|
|
{
|
|
exit 1
|
|
}
|
|
|
|
# Pull Docker images
|
|
Write-Step "Pulling images..."
|
|
$output = docker compose pull --quiet 2>&1
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error-Custom "Failed to pull Docker images"
|
|
Write-Host $output
|
|
exit $LASTEXITCODE
|
|
}
|
|
Write-Success "Images pulled successfully"
|
|
|
|
# Build Docker images
|
|
Write-Step "Building images..."
|
|
$output = docker compose build 2>&1
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error-Custom "Failed to build Docker images"
|
|
Write-Host $output
|
|
exit $LASTEXITCODE
|
|
}
|
|
Write-Success "Images built successfully"
|
|
|
|
# Generate Prometheus web config from .env
|
|
Write-Step "Generating Prometheus web config..."
|
|
New-PrometheusWebConfig
|
|
|
|
Write-Result ""
|
|
Write-Result "You can now use run.ps1 script or run: make run"
|