From 999c06805c0a12690b6847761e96daadb8f8fb53 Mon Sep 17 00:00:00 2001 From: Ryan Richter Date: Mon, 26 Jan 2026 16:48:53 -0500 Subject: [PATCH] (#151) Add Nexus, Jenkins, and CCM Packages to upgradeAllExceptions --- Start-C4bCcmSetup.ps1 | 5 +++++ Start-C4bJenkinsSetup.ps1 | 5 +++++ Start-C4bNexusSetup.ps1 | 4 ++++ tests/packages.ps1 | 11 +++++++++++ tests/server.tests.ps1 | 10 ++++++++++ 5 files changed, 35 insertions(+) diff --git a/Start-C4bCcmSetup.ps1 b/Start-C4bCcmSetup.ps1 index 3fb453b..2989086 100644 --- a/Start-C4bCcmSetup.ps1 +++ b/Start-C4bCcmSetup.ps1 @@ -184,6 +184,11 @@ process { } & Invoke-Choco @chocoArgs + # Add CCM & .Net Dependencies to upgradeAllExceptions list + $upgradeAllExceptions = choco config get --name=upgradeAllExceptions --limit-output + $chocoArgs = @('config', 'set', '--name=upgradeAllExceptions', "--value=dotnet-aspnetcoremodule-v2,dotnet-8.0-runtime,dotnet-8.0-aspnetruntime,chocolatey-management-database,chocolatey-management-service,chocolatey-management-web,$upgradeAllExceptions") + & Invoke-Choco @chocoArgs + # Setup Website SSL if ($Thumbprint) { Stop-CcmService diff --git a/Start-C4bJenkinsSetup.ps1 b/Start-C4bJenkinsSetup.ps1 index 0f5a668..c974a63 100644 --- a/Start-C4bJenkinsSetup.ps1 +++ b/Start-C4bJenkinsSetup.ps1 @@ -64,6 +64,11 @@ process { $chocoArgs = @('install', 'jenkins', "--source='ChocolateyInternal'", '-y', '--no-progress') & Invoke-Choco @chocoArgs + # Add Jenkins & Java Dependency to upgradeAllExceptions list + $upgradeAllExceptions = choco config get --name=upgradeAllExceptions --limit-output + $chocoArgs = @('config', 'set', '--name=upgradeAllExceptions', "--value=jenkins,temurin21jre,$upgradeAllExceptions") + & Invoke-Choco @chocoArgs + # Jenkins needs a moment Wait-Site Jenkins diff --git a/Start-C4bNexusSetup.ps1 b/Start-C4bNexusSetup.ps1 index 910a23f..03728fe 100644 --- a/Start-C4bNexusSetup.ps1 +++ b/Start-C4bNexusSetup.ps1 @@ -54,6 +54,10 @@ process { $chocoArgs = @('install', 'nexus-repository', '-y' ,'--no-progress', "--package-parameters='/Fqdn:localhost'") & Invoke-Choco @chocoArgs + # Add nexus-repository to upgradeAllExceptions list + $chocoArgs = @('config', 'set', '--name=upgradeAllExceptions', '--value=nexus-repository', '--limit-output') + & Invoke-Choco @chocoArgs + $chocoArgs = @('install', 'nexushell', '-y' ,'--no-progress') & Invoke-Choco @chocoArgs diff --git a/tests/packages.ps1 b/tests/packages.ps1 index 6ecaa87..06da21c 100644 --- a/tests/packages.ps1 +++ b/tests/packages.ps1 @@ -31,3 +31,14 @@ $RepositoryOnlyPackages = @( @{Name = 'chocolateygui.extension' } @{Name = 'dotnetfx' } ) +$upgradeAllExceptionPackages = @( + @{Name = 'chocolatey-management-database' } + @{Name = 'chocolatey-management-service' } + @{Name = 'chocolatey-management-web' } + @{Name = 'dotnet-8.0-aspnetruntime' } + @{Name = 'dotnet-8.0-runtime' } + @{Name = 'dotnet-aspnetcoremodule-v2' } + @{Name = 'jenkins' } + @{Name = 'nexus-repository' } + @{Name = 'Temurin21jre' } +) diff --git a/tests/server.tests.ps1 b/tests/server.tests.ps1 index a695d7a..96e8e5a 100644 --- a/tests/server.tests.ps1 +++ b/tests/server.tests.ps1 @@ -24,6 +24,16 @@ Describe "Server Integrity" { } } + Context "Packages Set as Upgrade All Exceptions" { + BeforeAll { + $upgradeAllExceptionsList = (choco config get --name=upgradeAllExceptions --limit-output).Split(',') + } + + It " is part of the upgradeAllExceptions list" -ForEach $upgradeAllExceptionPackages { + $Name | Should -BeIn $upgradeAllExceptionsList + } + } + Context "Readme File" { It "Readme file was created" { Test-Path (Join-Path "$env:PUBLIC\Desktop" -ChildPath 'Readme.html') | Should -Be $true