mixlib-install 2.1.8 → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/lib/mixlib/install/script_generator.rb +4 -1
- data/lib/mixlib/install/version.rb +1 -1
- data/support/install_command.ps1 +14 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85494cb7677e35f2fd1a84ec8c23ecfc0d24efef
|
4
|
+
data.tar.gz: 38048f01eafc6bd86d79cab807957e0e62a98ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489c05e749dd5b421d34b0366872dc9006d1cea865ab8e01b35126808b112341723e9cbb87588ce8b7d85c963d179e148a4049db59b905872e9ed2eeb4934f73
|
7
|
+
data.tar.gz: 89c412f80a84c223af0f329674affd1325ea9e2f846bf58df0f944c7429613d591d08923648e48b653b018c04f091d2c42d8fff1ef40eab39b17abae31cfa706
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [2.1.9]
|
4
|
+
- Add `download_directory` option to powershell install script
|
5
|
+
|
3
6
|
## [2.1.8]
|
4
7
|
- Query performance optimizations
|
5
|
-
- Add ChefClientFeature support to the
|
8
|
+
- Add ChefClientFeature support to the powershell install script
|
6
9
|
|
7
10
|
## [2.1.7]
|
8
11
|
- Add support for passing arguments to the MSI in install scripts
|
@@ -130,9 +130,12 @@ module Mixlib
|
|
130
130
|
# @return [String] shell variable lines
|
131
131
|
# @api private
|
132
132
|
def install_command_vars_for_powershell
|
133
|
+
d_flag = install_flags.nil? ? nil : install_flags.match(/-download_directory (\S+)/)
|
134
|
+
download_directory = d_flag.nil? ? "$env:TEMP" : d_flag[1]
|
133
135
|
[
|
134
136
|
shell_var("chef_omnibus_root", root),
|
135
|
-
shell_var("msi", "
|
137
|
+
shell_var("msi", "#{download_directory}\\chef-#{version}.msi"),
|
138
|
+
shell_var("download_directory", download_directory),
|
136
139
|
].tap do |vars|
|
137
140
|
if install_msi_url
|
138
141
|
vars << shell_var("chef_msi_url", install_msi_url)
|
data/support/install_command.ps1
CHANGED
@@ -43,8 +43,14 @@ Function Download-Chef($url, $sha256, $dst) {
|
|
43
43
|
Log "Download complete."
|
44
44
|
|
45
45
|
if ($sha256 -eq $null) { Log "Skipping sha256 verification" }
|
46
|
-
elseif (
|
47
|
-
else { throw "SHA256 for $dst
|
46
|
+
elseif (Verify-SHA256 $dst $sha256) { Log "Successfully verified $dst" }
|
47
|
+
else { throw "SHA256 for $dst does not match $sha256" }
|
48
|
+
}
|
49
|
+
|
50
|
+
Function Verify-SHA256($path, $sha256) {
|
51
|
+
if ($sha256 -eq $null) { return $false }
|
52
|
+
elseif (($dsha256 = Get-SHA256 $path) -eq $sha256) { return $true }
|
53
|
+
else { return $false }
|
48
54
|
}
|
49
55
|
|
50
56
|
Function Install-Chef($msi, $chef_omnibus_root) {
|
@@ -63,7 +69,6 @@ Function Install-Chef($msi, $chef_omnibus_root) {
|
|
63
69
|
if(!$result) { continue }
|
64
70
|
$installingChef = $False
|
65
71
|
}
|
66
|
-
Remove-Item $msi -Force
|
67
72
|
Log "Installation complete"
|
68
73
|
}
|
69
74
|
|
@@ -185,9 +190,13 @@ if (Check-UpdateChef $chef_omnibus_root $version) {
|
|
185
190
|
$url = $chef_msi_url
|
186
191
|
$sha256 = $null
|
187
192
|
}
|
188
|
-
$msi = Join-Path $
|
193
|
+
$msi = Join-Path $download_directory "$url".Split("/")[-1]
|
189
194
|
$msi = Unresolve-Path $msi
|
190
|
-
|
195
|
+
if (Verify-SHA256 $msi $sha256) {
|
196
|
+
Log "Skipping package download; found a matching package at $msi"
|
197
|
+
} else {
|
198
|
+
Download-Chef "$url" $sha256 $msi
|
199
|
+
}
|
191
200
|
Install-Chef $msi $chef_omnibus_root
|
192
201
|
} else {
|
193
202
|
Write-Host "-----> Chef Omnibus installation detected ($pretty_version)"
|