Skip to content

Commit cb0be0d

Browse files
JPRuskinryanrichter94
authored andcommitted
(#230) Change "files" directory to "packages" directory
The manifest folders lived in a folder named after one in the Ansible project. This didn't make sense here, where it often lives inside a /files/ directory already. This has been changed.
1 parent a42e30b commit cb0be0d

9 files changed

+24
-24
lines changed

OfflineInstallPreparation.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ if (-not $Licensed) {
9090
}
9191
Copy-Item $LicensePath $InstalledLicensePath -Force
9292
}
93-
$ExtensionSource = if (Test-Path $PSScriptRoot\files\chocolatey.extension.*.nupkg) {
94-
Convert-Path $PSScriptRoot\files\
93+
$ExtensionSource = if (Test-Path $PSScriptRoot\packages\chocolatey.extension.*.nupkg) {
94+
Convert-Path $PSScriptRoot\packages\
9595
} else {
9696
'https://licensedpackages.chocolatey.org/api/v2/'
9797
}
@@ -103,7 +103,7 @@ $PackageWorkingDirectory = Join-Path $WorkingDirectory "Packages"
103103
if (-not (Test-Path $PackageWorkingDirectory)) {
104104
$null = New-Item -Path $PackageWorkingDirectory -ItemType Directory -Force
105105
}
106-
foreach ($Package in (Get-Content $PSScriptRoot\files\chocolatey.json | ConvertFrom-Json).packages) {
106+
foreach ($Package in (Get-Content $PSScriptRoot\packages\chocolatey.json | ConvertFrom-Json).packages) {
107107
$ChocoArgs = @(
108108
"download", "$($Package.Name)"
109109
"--output-directory", $PackageWorkingDirectory
@@ -118,7 +118,7 @@ foreach ($Package in (Get-Content $PSScriptRoot\files\chocolatey.json | ConvertF
118118
}
119119

120120
try {
121-
if (-not (Get-ChocolateyPackageMetadata -Path $PackageWorkingDirectory -Id $Package.Name) -and -not (Get-ChocolateyPackageMetadata -Path "$PSScriptRoot\files\" -Id $Package.Name)) {
121+
if (-not (Get-ChocolateyPackageMetadata -Path $PackageWorkingDirectory -Id $Package.Name) -and -not (Get-ChocolateyPackageMetadata -Path "$PSScriptRoot\packages\" -Id $Package.Name)) {
122122
Write-Host "Downloading '$($Package.Name)'"
123123

124124
while ((Get-ChildItem $PackageWorkingDirectory -Filter *.nupkg).Where{$_.CreationTime -gt (Get-Date).AddMinutes(-1)}.Count -gt 5) {
@@ -132,18 +132,18 @@ foreach ($Package in (Get-Content $PSScriptRoot\files\chocolatey.json | ConvertF
132132
throw $_
133133
}
134134
}
135-
Move-Item -Path $PackageWorkingDirectory\*.nupkg -Destination $PSScriptRoot\files\
135+
Move-Item -Path $PackageWorkingDirectory\*.nupkg -Destination $PSScriptRoot\packages\
136136

137137
# Jenkins Plugins
138138
$PluginsWorkingDirectory = Join-Path $WorkingDirectory "JenkinsPlugins"
139139
if (-not (Test-Path $PluginsWorkingDirectory)) {
140140
$null = New-Item -Path $PluginsWorkingDirectory -ItemType Directory -Force
141141
}
142-
if (Test-Path $PSScriptRoot\files\JenkinsPlugins.zip) {
143-
Expand-Archive -Path $PSScriptRoot\files\JenkinsPlugins.zip -DestinationPath $PluginsWorkingDirectory -Force
142+
if (Test-Path $PSScriptRoot\packages\JenkinsPlugins.zip) {
143+
Expand-Archive -Path $PSScriptRoot\packages\JenkinsPlugins.zip -DestinationPath $PluginsWorkingDirectory -Force
144144
}
145145
$ProgressPreference = "Ignore"
146-
foreach ($Plugin in (Get-Content $PSScriptRoot\files\jenkins.json | ConvertFrom-Json).plugins) {
146+
foreach ($Plugin in (Get-Content $PSScriptRoot\packages\jenkins.json | ConvertFrom-Json).plugins) {
147147
$RestArgs = @{
148148
Uri = "https://updates.jenkins-ci.org/latest/$($Plugin.Name).hpi"
149149
OutFile = Join-Path $PluginsWorkingDirectory "$($Plugin.Name).hpi"
@@ -155,12 +155,12 @@ foreach ($Plugin in (Get-Content $PSScriptRoot\files\jenkins.json | ConvertFrom-
155155
Invoke-WebRequest @RestArgs -UseBasicParsing
156156
}
157157
}
158-
Compress-Archive -Path $PluginsWorkingDirectory\* -Destination $PSScriptRoot\files\JenkinsPlugins.zip -Force
158+
Compress-Archive -Path $PluginsWorkingDirectory\* -Destination $PSScriptRoot\packages\JenkinsPlugins.zip -Force
159159

160160
# BCryptDll
161161
$null = Get-BcryptDll
162162

163163
# License
164-
if ($LicensePath -ne "$PSScriptRoot\files\chocolatey.license.xml") {
165-
Copy-Item -Path (Convert-Path $LicensePath) -Destination $PSScriptRoot\files\chocolatey.license.xml
164+
if ($LicensePath -ne "$PSScriptRoot\packages\chocolatey.license.xml") {
165+
Copy-Item -Path (Convert-Path $LicensePath) -Destination $PSScriptRoot\packages\chocolatey.license.xml
166166
}

Start-C4bCcmSetup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ process {
2929
# Dot-source helper functions
3030
. .\scripts\Get-Helpers.ps1
3131

32-
$Packages = (Get-Content $PSScriptRoot\files\chocolatey.json | ConvertFrom-Json).packages
32+
$Packages = (Get-Content $PSScriptRoot\packages\chocolatey.json | ConvertFrom-Json).packages
3333

3434
# DB Setup
3535
Write-Host "Installing SQL Server Express"

Start-C4bJenkinsSetup.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ process {
6767
Stop-Service -Name Jenkins
6868

6969
#region Jenkins Plugin Install & Update
70-
$JenkinsPlugins = (Get-Content $PSScriptRoot\files\jenkins.json | ConvertFrom-Json).plugins
70+
$JenkinsPlugins = (Get-Content $PSScriptRoot\packages\jenkins.json | ConvertFrom-Json).plugins
7171

72-
if (Test-Path $PSScriptRoot\files\JenkinsPlugins.zip) {
73-
Expand-Archive -Path $PSScriptRoot\files\JenkinsPlugins.zip -DestinationPath $jenkinsHome\plugins\ -Force
72+
if (Test-Path $PSScriptRoot\packages\JenkinsPlugins.zip) {
73+
Expand-Archive -Path $PSScriptRoot\packages\JenkinsPlugins.zip -DestinationPath $jenkinsHome\plugins\ -Force
7474
}
7575

7676
# Performance is killed by Invoke-WebRequest's progress bars, turning them off to speed this up

Start-C4bNexusSetup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ process {
2828
# Dot-source helper functions
2929
. .\scripts\Get-Helpers.ps1
3030

31-
$Packages = (Get-Content $PSScriptRoot\files\chocolatey.json | ConvertFrom-Json).packages
31+
$Packages = (Get-Content $PSScriptRoot\packages\chocolatey.json | ConvertFrom-Json).packages
3232

3333
# Install base nexus-repository package
3434
Write-Host "Installing Sonatype Nexus Repository"
@@ -57,7 +57,7 @@ process {
5757
$NuGetApiKey = (Get-NexusNuGetApiKey -Credential $Credential).apikey
5858

5959
# Push all packages from previous steps to NuGet repo
60-
Get-ChildItem -Path "$env:SystemDrive\choco-setup\files\files" -Filter *.nupkg | ForEach-Object {
60+
Get-ChildItem -Path "$env:SystemDrive\choco-setup\files\packages" -Filter *.nupkg | ForEach-Object {
6161
choco push $_.FullName --source "$((Get-NexusRepository -Name 'ChocolateyInternal').url)/index.json" --apikey $NugetApiKey --force
6262
}
6363

Start-C4bSetup.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ param(
2121
[Parameter(ParameterSetName='Attended')]
2222
[string]
2323
$LicenseFile = $(
24-
if (Test-Path $PSScriptRoot\files\chocolatey.license.xml) {
24+
if (Test-Path $PSScriptRoot\packages\chocolatey.license.xml) {
2525
# Offline setup has been run, we should use that license.
26-
Join-Path $PSScriptRoot "files\chocolatey.license.xml"
26+
Join-Path $PSScriptRoot "packages\chocolatey.license.xml"
2727
} elseif (Test-Path $env:ChocolateyInstall\license\chocolatey.license.xml) {
2828
# Chocolatey is already installed, we can use that license.
2929
Join-Path $env:ChocolateyInstall "license\chocolatey.license.xml"
@@ -99,7 +99,7 @@ try {
9999
Write-Host "Setting up initial directories in"$env:SystemDrive\choco-setup"" -ForegroundColor Green
100100
$ChocoPath = "$env:SystemDrive\choco-setup"
101101
$FilesDir = Join-Path $ChocoPath "files"
102-
$PkgsDir = Join-Path $FilesDir "files"
102+
$PkgsDir = Join-Path $FilesDir "packages"
103103
$TempDir = Join-Path $ChocoPath "temp"
104104
$TestDir = Join-Path $ChocoPath "tests"
105105
@($ChocoPath, $FilesDir, $PkgsDir, $TempDir, $TestDir) | ForEach-Object {
@@ -126,8 +126,8 @@ try {
126126

127127
& $FilesDir\OfflineInstallPreparation.ps1 -LicensePath $LicenseFile
128128

129-
if (Test-Path $FilesDir\files\*.nupkg) {
130-
choco source add --name LocalChocolateySetup --source $FilesDir\files\ --Priority 1
129+
if (Test-Path $FilesDir\packages\*.nupkg) {
130+
choco source add --name LocalChocolateySetup --source $FilesDir\packages\ --Priority 1
131131
}
132132

133133
# Set Choco Server Chocolatey Configuration
File renamed without changes.
File renamed without changes.

scripts/Create-ChocoLicensePkg.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param(
1313
# Local path used to build the license package.
1414
[Parameter()]
1515
[string]
16-
$PackagesPath = "$env:SystemDrive\choco-setup\files\files",
16+
$PackagesPath = "$env:SystemDrive\choco-setup\files\packages",
1717

1818
# Path to the license file.
1919
[Parameter()]

tests/jenkins.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Describe "Jenkins Configuration" {
7474

7575
Context "Required Plugins" {
7676
BeforeDiscovery {
77-
$ExpectedPlugins = (Get-Content $PSScriptRoot\..\files\jenkins.json | ConvertFrom-Json).plugins.name
77+
$ExpectedPlugins = (Get-Content $PSScriptRoot\..\packages\jenkins.json | ConvertFrom-Json).plugins.name
7878
}
7979

8080
BeforeAll {

0 commit comments

Comments
 (0)