Skip to content

Commit

Permalink
put more vars into config and rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsweetman committed Dec 17, 2024
1 parent 7d52947 commit 775d8fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ $GlobalConfig = @{
"RegistryPath" = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon"
"LegalNoticeCaption" = "IMPORTANT"
"LegalNoticeText" = "This system is restricted to authorized users only. Individuals who attempt unauthorized access will be prosecuted. If you are unauthorized terminate access now. Click OK to indicate your acceptance of this information"
"WorkingDirectory" = "E:\Software"
"AppDirectory" = "E:\App"
}
"nomis-combined-reporting-development" = @{

}
"nomis-combined-reporting-test" = @{
# "sysDbName" = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ $GlobalConfig = @{
"RegistryPath" = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon"
"LegalNoticeCaption" = "IMPORTANT"
"LegalNoticeText" = "This system is restricted to authorized users only. Individuals who attempt unauthorized access will be prosecuted. If you are unauthorized terminate access now. Click OK to indicate your acceptance of this information"
"WorkingDirectory" = "E:\Software"
"AppDirectory" = "E:\App"
}
"oasys-national-reporting-development" = @{
"OnrShortcuts" = @{
}

}
"oasys-national-reporting-test" = @{
"sysDbName" = "T2BOSYS"
Expand Down
19 changes: 10 additions & 9 deletions powershell/Scripts/UserDataScripts/Bods.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ function Get-Config {
$domainName = ($Tags.Tags | Where-Object { $_.Key -eq "domain-name" }).Value

if ($ApplicationTag -eq "oasys-national-reporting") {
$configPath = Join-Path -Path $PSScriptRoot -ChildPath "..\..\Configs\ONR\config.ps1"
$configPath = Join-Path -Path $PSScriptRoot -ChildPath "..\..\Configs\ONR\onr_config.ps1"
}
elseif ($ApplicationTag -eq "nomis-combined-reporting") {
$configPath = Join-Path -Path $PSScriptRoot -ChildPath "..\..\Configs\NCR\config.ps1"
$configPath = Join-Path -Path $PSScriptRoot -ChildPath "..\..\Configs\NCR\ncr_config.ps1"
}
else {
Write-Error "Unexpected application tag value: $ApplicationTag"
Expand Down Expand Up @@ -875,9 +875,6 @@ Set-TimeZone -Name "GMT Standard Time"

$Config = Get-Config

$WorkingDirectory = "E:\Software"
$AppDirectory = "E:\App"

$ModulesRepo = Join-Path $PSScriptRoot '..\..\Modules'

# {{{ join domain if domain-name tag is set
Expand Down Expand Up @@ -909,10 +906,10 @@ else {
# {{{ prepare assets
$ErrorActionPreference = "Stop"

New-Item -ItemType Directory -Path $WorkingDirectory -Force
New-Item -ItemType Directory -Path $AppDirectory -Force
New-Item -ItemType Directory -Path $Config.WorkingDirectory -Force
New-Item -ItemType Directory -Path $Config.AppDirectory -Force

Set-Location -Path $WorkingDirectory
Set-Location -Path $Config.WorkingDirectory

if ($($Config.application) -eq "oasys-national-reporting") {
Install-Oracle19cClient -Config $Config
Expand All @@ -923,7 +920,7 @@ if ($($Config.application) -eq "oasys-national-reporting") {
Set-LoginText -Config $Config
New-SharedDriveShortcut -Config $Config
}
else {
elseif ($($Config.application) -eq "nomis-combined-reporting") {
# IMPORTANT: NCR BODS installation & TNS files etc. not ready yet
Install-Oracle19cClient -Config $Config
# New-TnsOraFile -Config $Config
Expand All @@ -933,4 +930,8 @@ else {
Set-LoginText -Config $Config
# New-SharedDriveShortcut -Config $Config
}
else {
Write-Error "No application tag found, exiting"
Exit 1
}
# }}}

0 comments on commit 775d8fa

Please sign in to comment.