refactor(agent): changed to have the test servers on there own push for better testing

production servers will soon pull a build from git rather and push the zip so splitting things up
now
This commit is contained in:
2026-04-10 14:12:02 -05:00
parent 9d39c13510
commit 3bf024cfc9

View File

@@ -27,17 +27,6 @@ $Servers = @(
token = "usday1" token = "usday1"
loc = "D$\LST_V3" loc = "D$\LST_V3"
}, },
[PSCustomObject]@{
server = "usmcd1vms036"
token = "test1"
loc = "E$\LST_V3"
},
[PSCustomObject]@{
server = "usiow1vms036"
token = "test2"
loc = "E$\LST_V3"
}
,
[PSCustomObject]@{ [PSCustomObject]@{
server = "usweb1vms006" server = "usweb1vms006"
token = "usweb1" token = "usweb1"
@@ -86,9 +75,10 @@ function Show-Menu {
Write-Host "===============================" Write-Host "==============================="
Write-Host "1. Build app" Write-Host "1. Build app"
Write-Host "2. Deploy New Release" Write-Host "2. Deploy New Release"
Write-Host "3. Upgrade Node" Write-Host "3. Deploy Test Servers"
Write-Host "4. Update Postgres" Write-Host "4. Upgrade Node"
Write-Host "5. Exit" Write-Host "5. Update Postgres"
Write-Host "6. Exit"
Write-Host "" Write-Host ""
} }
@@ -345,7 +335,7 @@ function Update-Server {
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
Write-Host "Install/update completed." Write-Host "Install/update completed."
# do the migrations # do the migrations
Push-Location $LocalPath # Push-Location $LocalPath
Write-Host "Running migrations" Write-Host "Running migrations"
npm run dev:db:migrate npm run dev:db:migrate
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
@@ -406,6 +396,45 @@ do {
} }
} }
"3" { "3" {
$TestServers = @(
[PSCustomObject]@{
server = "usmcd1vms036"
token = "test1"
loc = "E$\LST_V3"
},
[PSCustomObject]@{
server = "usiow1vms036"
token = "test2"
loc = "E$\LST_V3"
}
)
$testServer = Select-Server -List $TestServers
if($testServer -eq "all") {
Write-Host "Updating all servers"
for ($i = 0; $i -lt $TestServers.Count; $i++) {
Write-Host "Updating $($TestServers[$i].server)"
Update-Server -Server $TestServers[$i].server -Destination $TestServers[$i].loc -Token $TestServers[$i].token
Start-Sleep -Seconds 1
}
Read-Host -Prompt "Press Enter to continue..."
}
if ($testServer -ne "all") {
Write-Host "You selected $($testServer.server)"
# do the update to the server.
# copy to the server
Update-Server -Server $testServer.server -Destination $testServer.loc -Token $testServer.token
# stop service
# extract zip
# run update check
# run migration
# start service backup
Read-Host -Prompt "Press Enter to continue..."
}
}
"4" {
Write-Host "Choose Server to upgrade node on" Write-Host "Choose Server to upgrade node on"
$server = Select-Server -List $Servers $server = Select-Server -List $Servers
@@ -430,7 +459,7 @@ do {
Read-Host -Prompt "Press Enter to continue..." Read-Host -Prompt "Press Enter to continue..."
} }
} }
"4" { "5" {
Write-Host "Choose Server to upgrade postgres on" Write-Host "Choose Server to upgrade postgres on"
$server = Select-Server -List $Servers $server = Select-Server -List $Servers
@@ -456,7 +485,7 @@ do {
} }
} }
"5" { "6" {
Write-Host "Exiting..." Write-Host "Exiting..."
exit exit
} }