Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add install_strategy option to bootstrap install scripts #232

Merged
merged 3 commits into from
Aug 17, 2017

Conversation

wrightp
Copy link

@wrightp wrightp commented Aug 16, 2017

This PR is part of JEX-643.

When install_strategy is set to once the install scripts will not install packages when the product is already installed (validated by root paths). All other conditions behave in the current manner which is to always install.

Signed-off-by: Patrick Wright <[email protected]>
@wrightp wrightp requested a review from a team August 16, 2017 20:00
Signed-off-by: Patrick Wright <[email protected]>
@wrightp wrightp force-pushed the wrightp/install-strategy branch from 08c36dd to d3048e7 Compare August 16, 2017 20:03
@wrightp wrightp changed the title Add install_strategy option to install.sh and install.ps1 Add install_strategy option to bootstrap install scripts Aug 16, 2017
@@ -0,0 +1,11 @@
execute "bundle exec ruby -e \"require 'mixlib/install'; puts Mixlib::Install.new(product_name: 'chef', product_version: :latest, channel: :stable, install_command_options: {install_strategy: 'once'}).install_command\" > ../.acceptance_data/ubuntu_install_command_once.sh" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we maybe do a heredoc or something just to make this easier to read?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not supposed to look at that @scotthain❗️

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a generic comment to all provision recipes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'll allow it ;)

@@ -0,0 +1,12 @@
execute "bundle exec ruby -e \"require 'mixlib/install'; puts Mixlib::Install.install_ps1, 'install -install_strategy once'\" > ../.acceptance_data/powershell_install_once.ps1" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with heredoc?

Signed-off-by: Patrick Wright <[email protected]>
)

if ((Test-Path "$env:systemdrive\opscode\$project\embedded") -and ($install_strategy -eq 'once')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for the mismatch on which path is checked on bash vs. powershell (root vs root/embedded)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thommay Do you recall if there was a specific reason for the difference in path checking for
ps1 and shell?

@wrightp wrightp merged commit 18f2a1f into master Aug 17, 2017
@tas50 tas50 added Expeditor: Skip Version Bump Used to skip built_in:bump_version and removed Version: Skip Bump labels Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expeditor: Skip Version Bump Used to skip built_in:bump_version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants