mixlib-install 3.14.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mixlib/install/cli.rb +2 -1
- data/lib/mixlib/install/generator/bourne/scripts/check_product.sh +11 -3
- data/lib/mixlib/install/generator/bourne/scripts/script_cli_parameters.sh.erb +5 -0
- data/lib/mixlib/install/generator/bourne.rb +23 -3
- data/lib/mixlib/install/generator/powershell/scripts/install_project.ps1.erb +24 -10
- data/lib/mixlib/install/generator/powershell.rb +5 -0
- data/lib/mixlib/install/options.rb +1 -0
- data/lib/mixlib/install/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87576368d2d140a99f1e02a508c19bb3d55dbc637ca3b4d6b39f6bbfcd857ad6
|
|
4
|
+
data.tar.gz: 4114e92d08cba4ea18093bfaa2e0f02b584dda06de878e56e11fd2c68aa58b9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 428a3a79f93b46f570ac709eaf7fcae54360dc893742360bf42b02ee0565c2992426d1588b4cd4baf6ae7d84898c284148a284824dece7d9890e75964fcea425
|
|
7
|
+
data.tar.gz: 991621b4937be08512cc2bb556a3848485a2a2e0223dc05382987a400131e49d20536d06df04c84a9d3d18acd10d6f93a7e6d34bb83c3022999fcfe59b4d4756
|
data/lib/mixlib/install/cli.rb
CHANGED
|
@@ -86,7 +86,8 @@ If no earlier version is found the earliest version available will be set.",
|
|
|
86
86
|
}.tap do |opt|
|
|
87
87
|
opt[:platform] = options[:platform] if options[:platform]
|
|
88
88
|
opt[:platform_version] = options[:platform_version] if options[:platform_version]
|
|
89
|
-
|
|
89
|
+
# Use license_id from options if provided, otherwise check CHEF_LICENSE_KEY env var
|
|
90
|
+
opt[:license_id] = options[:license_id] || ENV["CHEF_LICENSE_KEY"]
|
|
90
91
|
end
|
|
91
92
|
|
|
92
93
|
# auto detect platform options if not configured
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
# Check for
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Check for product installation in various locations
|
|
2
|
+
if [ "$project" = "chef" ] || [ "$project" = "chef-ice" ]; then
|
|
3
|
+
# For chef or chef-ice, look for chef-infra-client paths
|
|
4
|
+
install_paths="/hab/pkgs/chef/chef-infra-client/*/*/bin /opt/chef/bin"
|
|
5
|
+
else
|
|
6
|
+
# For other products, look for product-specific paths
|
|
7
|
+
install_paths="/hab/pkgs/chef/$project/*/*/bin /opt/$project/bin"
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
for path in $install_paths; do
|
|
11
|
+
if [ -d "$path" ] 2>/dev/null && [ "x$install_strategy" = "xonce" ]; then
|
|
4
12
|
echo "$project installation detected at $path"
|
|
5
13
|
echo "install_strategy set to 'once'"
|
|
6
14
|
echo "Nothing to install"
|
|
@@ -24,7 +24,19 @@ module Mixlib
|
|
|
24
24
|
def self.install_sh(context)
|
|
25
25
|
install_command = []
|
|
26
26
|
install_command << get_script("helpers.sh", context)
|
|
27
|
+
# If license_id is provided in context, pre-set it as a variable
|
|
28
|
+
if context[:license_id] && !context[:license_id].to_s.empty?
|
|
29
|
+
install_command << "# License ID provided via context"
|
|
30
|
+
install_command << "license_id='#{context[:license_id]}'"
|
|
31
|
+
end
|
|
27
32
|
install_command << get_script("script_cli_parameters.sh")
|
|
33
|
+
# Check for CHEF_LICENSE_KEY in execution environment if not already set
|
|
34
|
+
install_command << <<~BASH.chomp
|
|
35
|
+
# Use CHEF_LICENSE_KEY from execution environment if license_id not set
|
|
36
|
+
if [ -z "${license_id:-}" ] && [ -n "${CHEF_LICENSE_KEY:-}" ]; then
|
|
37
|
+
license_id="$CHEF_LICENSE_KEY"
|
|
38
|
+
fi
|
|
39
|
+
BASH
|
|
28
40
|
install_command << get_script("check_product.sh")
|
|
29
41
|
install_command << get_script("platform_detection.sh")
|
|
30
42
|
install_command << get_script("proxy_env.sh")
|
|
@@ -62,10 +74,18 @@ project=#{options.product_name}
|
|
|
62
74
|
version=#{options.product_version}
|
|
63
75
|
channel=#{options.channel}
|
|
64
76
|
EOS
|
|
65
|
-
# Add license_id if provided
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
# Add license_id if provided, otherwise use CHEF_LICENSE_KEY env var
|
|
78
|
+
license_id_value = options.license_id || ENV["CHEF_LICENSE_KEY"]
|
|
79
|
+
if license_id_value && !license_id_value.to_s.empty?
|
|
80
|
+
vars += "license_id=#{license_id_value}\n"
|
|
68
81
|
end
|
|
82
|
+
# Check for CHEF_LICENSE_KEY in execution environment if not already set
|
|
83
|
+
vars += <<EOS
|
|
84
|
+
# Use CHEF_LICENSE_KEY from execution environment if license_id not set
|
|
85
|
+
if [ -z "${license_id:-}" ] && [ -n "${CHEF_LICENSE_KEY:-}" ]; then
|
|
86
|
+
license_id="$CHEF_LICENSE_KEY"
|
|
87
|
+
fi
|
|
88
|
+
EOS
|
|
69
89
|
vars += install_command_vars
|
|
70
90
|
vars
|
|
71
91
|
end
|
|
@@ -62,14 +62,28 @@ function Install-Project {
|
|
|
62
62
|
$license_id
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
-
#
|
|
66
|
-
$
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
# Use CHEF_LICENSE_KEY environment variable if license_id not provided
|
|
66
|
+
if ([string]::IsNullOrEmpty($license_id) -and -not [string]::IsNullOrEmpty($env:CHEF_LICENSE_KEY)) {
|
|
67
|
+
$license_id = $env:CHEF_LICENSE_KEY
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# Check for product installation in various locations
|
|
71
|
+
if ($project -eq 'chef' -or $project -eq 'chef-ice') {
|
|
72
|
+
# For chef or chef-ice, look for chef-infra-client paths
|
|
73
|
+
$install_locations = @(
|
|
74
|
+
"$env:systemdrive\hab\pkgs\chef\chef-infra-client\*\*\bin",
|
|
75
|
+
"$env:systemdrive\<%= windows_dir %>\chef\bin"
|
|
76
|
+
)
|
|
77
|
+
} else {
|
|
78
|
+
# For other products, look for product-specific paths
|
|
79
|
+
$install_locations = @(
|
|
80
|
+
"$env:systemdrive\hab\pkgs\chef\$project\*\*\bin",
|
|
81
|
+
"$env:systemdrive\<%= windows_dir %>\$project\bin"
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
foreach ($path in $install_locations) {
|
|
71
85
|
$resolved = Get-Item $path -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
72
|
-
if ($resolved -and (Test-Path $resolved.FullName) -and ($install_strategy -eq 'once')) {
|
|
86
|
+
if ($resolved -and (Test-Path $resolved.FullName -PathType Container) -and ($install_strategy -eq 'once')) {
|
|
73
87
|
Write-Host "$project installation detected at $($resolved.FullName)"
|
|
74
88
|
Write-Host "install_strategy set to 'once'"
|
|
75
89
|
Write-Host "Nothing to install"
|
|
@@ -147,14 +161,14 @@ function Install-Project {
|
|
|
147
161
|
if ($pscmdlet.ShouldProcess("$($download_url)", "Download $project")) {
|
|
148
162
|
Write-Host "Downloading $project from $($download_url) to $download_destination."
|
|
149
163
|
$download_result = Get-WebContent $download_url -filepath $download_destination
|
|
150
|
-
|
|
164
|
+
|
|
151
165
|
# For licensed downloads, extract actual filename from Content-Disposition
|
|
152
166
|
if (-not [string]::IsNullOrEmpty($license_id) -and $download_result -and $download_result.Filename) {
|
|
153
167
|
$actual_filename = $download_result.Filename
|
|
154
168
|
Write-Host "Extracted filename from Content-Disposition: $actual_filename"
|
|
155
|
-
|
|
169
|
+
|
|
156
170
|
$final_destination = join-path $download_directory $actual_filename
|
|
157
|
-
|
|
171
|
+
|
|
158
172
|
# Move temp file to final location with correct name
|
|
159
173
|
if ($download_destination -ne $final_destination) {
|
|
160
174
|
Write-Host "Moving to final location: $final_destination"
|
|
@@ -29,6 +29,11 @@ module Mixlib
|
|
|
29
29
|
|
|
30
30
|
install_command = []
|
|
31
31
|
install_command << ps1_modularize(install_project_module.join("\n"), "Installer-Module")
|
|
32
|
+
# If license_id is provided in context, add it to the default install command
|
|
33
|
+
if context[:license_id] && !context[:license_id].to_s.empty?
|
|
34
|
+
install_command << "# License ID provided via context - adding to install command"
|
|
35
|
+
install_command << "install -license_id '#{context[:license_id]}'"
|
|
36
|
+
end
|
|
32
37
|
install_command.join("\n\n")
|
|
33
38
|
end
|
|
34
39
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mixlib-install
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thom May
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-01-
|
|
12
|
+
date: 2026-01-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mixlib-shellout
|