You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.2 KiB
32 lines
1.2 KiB
# Deploy nginx config console.gisportal.id (Fase 1 — tanpa ubah Docker) |
|
# Usage: .\scripts\deploy-geonet-console-nginx.ps1 |
|
|
|
$ErrorActionPreference = "Stop" |
|
|
|
$HostAddr = "10.100.1.24" |
|
$SshPort = 22 |
|
$SshMac = "hmac-sha1" |
|
$SshUser = "root" |
|
$ProjectRoot = Split-Path $PSScriptRoot -Parent |
|
$ConfLocal = Join-Path $ProjectRoot "geonet-console\nginx\geonet-console.conf" |
|
$ConfRemote = "/etc/nginx/conf.d/production/geonet-console.conf" |
|
|
|
if (-not (Test-Path $ConfLocal)) { |
|
throw "Config tidak ditemukan: $ConfLocal" |
|
} |
|
|
|
Write-Host "==> Upload nginx config..." |
|
scp -o BatchMode=yes -o MACs=$SshMac -P $SshPort $ConfLocal "${SshUser}@${HostAddr}:${ConfRemote}" |
|
|
|
Write-Host "==> Test + reload nginx..." |
|
ssh -o BatchMode=yes -m $SshMac "${SshUser}@${HostAddr}" -p $SshPort "nginx -t && systemctl reload nginx" |
|
if ($LASTEXITCODE -ne 0) { throw "nginx -t failed; config not reloaded." } |
|
|
|
Write-Host "==> Verify endpoints..." |
|
ssh -o BatchMode=yes -m $SshMac "${SshUser}@${HostAddr}" -p $SshPort @" |
|
curl -sk -o /dev/null -w 'console /up: %{http_code}\n' https://console.gisportal.id/up |
|
curl -sk -o /dev/null -w 'legacy /up: %{http_code}\n' https://databaselist.gisportal.id/up |
|
"@ |
|
|
|
Write-Host "" |
|
Write-Host "Nginx Fase 1 selesai: https://console.gisportal.id"
|
|
|