Skip to content

Commit

Permalink
Merge pull request #260 from chocolatey/QSG-259
Browse files Browse the repository at this point in the history
(#259) Remove Pin for Nexus & Disable usePackageRepositoryOptimizations Feature
  • Loading branch information
JPRuskin authored Aug 29, 2024
2 parents 63ef04c + a424fdd commit 9e02058
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Start-C4bNexusSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ process {

# Install base nexus-repository package
Write-Host "Installing Sonatype Nexus Repository"
$chocoArgs = @('install', 'nexus-repository', "--version=$($Packages.Where{$_.Name -eq 'nexus-repository'}.Version)", '--pin', '-y' ,'--no-progress', "--package-parameters='/Fqdn:localhost'")
$chocoArgs = @('install', 'nexus-repository', '-y' ,'--no-progress', "--package-parameters='/Fqdn:localhost'")
& choco @chocoArgs

#Build Credential Object, Connect to Nexus
Expand Down Expand Up @@ -90,6 +90,9 @@ process {
Write-Error "ChocolateyInstall.ps1 script signature is not valid. Please investigate."
}

# Nexus NuGet V3 Compatibility
choco feature disable --name="'usePackageRepositoryOptimizations'"

# Add ChocolateyInternal as a source repository
choco source add -n 'ChocolateyInternal' -s "$((Get-NexusRepository -Name 'ChocolateyInternal').url)/index.json" --priority 1

Expand Down
2 changes: 1 addition & 1 deletion files/chocolatey.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{ "name": "KB3035131", "internalize": false },
{ "name": "KB3063858", "internalize": false },
{ "name": "microsoft-edge" },
{ "name": "nexus-repository", "version": "3.70.1.2" },
{ "name": "nexus-repository" },
{ "name": "sql-server-express" },
{ "name": "temurin21jre" },
{ "name": "vcredist140" }
Expand Down
3 changes: 3 additions & 0 deletions scripts/ClientSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ $script = $webClient.DownloadString("https://${hostAddress}/repository/choco-ins
choco config set cacheLocation $env:ChocolateyInstall\choco-cache
choco config set commandExecutionTimeoutSeconds 14400

# Nexus NuGet V3 Compatibility
choco feature disable --name="'usePackageRepositoryOptimizations'"

if ($InternetEnabled) {
choco source add --name="'ChocolateyInternal'" --source="'$RepositoryUrl'" --allow-self-service --user="'$($Credential.UserName)'" --password="'$($Credential.GetNetworkCredential().Password)'" --priority=1
}
Expand Down

0 comments on commit 9e02058

Please sign in to comment.