[CHEF-29379] Install.sh/ps1 updates for chef-ice#415
Conversation
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
|
| determine_package_type() { | ||
| case "$platform" in | ||
| "debian"|"ubuntu"|"linuxmint") | ||
| echo "deb" | ||
| ;; | ||
| "centos"|"redhat"|"fedora"|"rocky"|"amazon"|"el") | ||
| echo "rpm" | ||
| ;; | ||
| "sles"|"opensuseleap") | ||
| echo "rpm" | ||
| ;; | ||
| "aix") | ||
| echo "bff" | ||
| ;; | ||
| "solaris2") | ||
| echo "pkg" | ||
| ;; | ||
| "mac_os_x") | ||
| echo "dmg" | ||
| ;; | ||
| *) | ||
| echo "Unknown package type" | ||
| report_bug | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| } |
There was a problem hiding this comment.
This limit's what OS's are able to download where in the past due to many debian/ubuntu/rhel variants out there we have supported chef-client being able to be installed on those systems but are not officially supported and are self-supported by the users.
| if test -d "/opt/$project" && test "x$install_strategy" = "xonce"; then | ||
| echo "$project installation detected" | ||
| echo "install_strategy set to 'once'" | ||
| echo "Nothing to install" | ||
| exit | ||
| fi |
There was a problem hiding this comment.
This only checks for the omnibus version of chef-client and doesn't support the new habitat pathing/packaging check. So chef-ice will repeat installing on every test-kitchen subsequent runs.
| # $tmp_dir: | ||
| # | ||
| # $license_id | ||
| # $package_manager: |
There was a problem hiding this comment.
what does this new package_manager do and or used for? how does this affect linux clients?
|
This is superseded by #417 and will become the source of truth for install.sh and install.ps1 scripts vs this proposing to use the new api's as source of truth. |



Description
This is a follow-up PR for #408. In this PR, we're primarily focusing on synchronising the install.sh/ps1 templates with the latest versions from the download APIs and adding support for the chef-ice product.
The changes enhance both Bash (install.sh) and PowerShell (install.ps1) script templates to support:
package_manager(pm) parameter instead ofplatform_version(pv)Changes Made
Bash Script Templates (Bourne)
Modified Files:
lib/mixlib/install/generator/base.rb
omnitruck_endpointcalculation logic based on license_idlib/mixlib/install/generator/bourne.rb
base_urlandlicense_idcontext to fetch_package.sh.erblib/mixlib/install/generator/bourne/scripts/platform_detection.sh
determine_package_type()function for detecting .rpm, .deb, .msi, .pkg, .dmg extensionslib/mixlib/install/generator/bourne/scripts/script_cli_parameters.sh.erb
-ifor package_manager parameterlib/mixlib/install/generator/bourne/scripts/fetch_metadata.sh.erb
modify_responsefunction for JSON to text format conversionlib/mixlib/install/generator/bourne/scripts/fetch_package.sh → fetch_package.sh.erb
lib/mixlib/install/generator/bourne/scripts/helpers.sh.erb
modify_response()function to convert JSON API responses to text formatPowerShell Script Templates
Modified Files:
New Files:
Get-ProjectFileNamefor fetching actual filenames from /fileName endpointUpdated Files:
lib/mixlib/install/generator/powershell/scripts/get_project_metadata.ps1.erb
package_managerparameter (validateset: msi, pm)lib/mixlib/install/generator/powershell/scripts/install_project.ps1.erb
package_managerparameter with automatic detectionRelated Issue
Types of changes
Checklist:
Gemfile.lockhas changed, I have used--conservativeto do it and included the full output in the Description above.