feat(app): stats added in to check if build in last build and also if theres a pending file
This commit is contained in:
@@ -186,6 +186,43 @@ function Update-Server {
|
||||
Write-Output "[$key] already exists -> skipping"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# update the controller .env as well to make sure we have anything enw in here.
|
||||
$requiredController = @(
|
||||
@{ Key = "DATABASE_HOST"; Value = "localhost"; Comment = "used for better auth secrets" },
|
||||
@{ Key = "DATABASE_PORT"; Value = 5432; Comment = "The better auth url" }
|
||||
@{ Key = "DATABASE_USER"; Value = "postgres"; Comment = "" }
|
||||
@{ Key = "DATABASE_PASSWORD"; Value = "obelix"; Comment = "" }
|
||||
@{ Key = "DATABASE_DB"; Value = "lst$(if ($token -eq "usiow2") { "_2" })"; Comment = "" }
|
||||
)
|
||||
|
||||
$envFileController = "$LocalPath\controller\.env"
|
||||
Write-Host $envFileController
|
||||
|
||||
if (-not (Test-Path $envFileController)) {
|
||||
New-Item -ItemType File -Path $envFileController -Force | Out-Null
|
||||
}
|
||||
|
||||
$lines = Get-Content $envFileController
|
||||
|
||||
foreach ($item in $requiredController) {
|
||||
$key = $item.Key
|
||||
$value = $item.Value
|
||||
$comment = "# $($item.Comment)"
|
||||
|
||||
$exists = $lines | Where-Object { $_ -match "^\s*$key\s*=" }
|
||||
|
||||
if (-not $exists) {
|
||||
Write-Output "[$key] missing -> adding to .env"
|
||||
Add-Content -Path $envFileController -Value "`n$comment"
|
||||
Add-Content -Path $envFileController -Value "$key=$value"
|
||||
}
|
||||
else {
|
||||
Write-Output "[$key] already exists -> skipping"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ param (
|
||||
# example string to pass over, you must be in the script dir when you run this script. or it will fail to find the linked scripts
|
||||
|
||||
# If we do not pass plant to update over it will auto do all plants if we want a specific plant we need to do like below
|
||||
# .\update-controllers.ps1 -App_Path "C:\Users\matthes01\Documents\lst" -Token "test3" -BuildController yes -PlantToUpdate "usmcd1vms036" -Remote_Path "E$\LST"
|
||||
# .\update-controllers.ps1 -App_Path "C:\Users\matthes01\Documents\lst" -Token "usiow2" -BuildController no -PlantToUpdate "usiow1vms006" -Remote_Path "D$\LST\lst_2"
|
||||
# .\update-controllers.ps1 -App_Path "C:\Users\matthes01\Documents\lst" -Token "test3" -BuildController yes
|
||||
|
||||
$Plants = @(
|
||||
|
||||
Reference in New Issue
Block a user