mixlib-install 3.11.5 → 3.11.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d850766fa7c4d79a4f76479938b337a4c574cffddd3ae03656f76769b23dd3d6
4
- data.tar.gz: 7050b957d09ca7a9dee51ba33456fb6e4cd26f5abd7dd5fffc71d4380fb2068b
3
+ metadata.gz: 329b4dcdda0b764ae109f7cc9390cde578b9bf596056a122348d10bc74377c04
4
+ data.tar.gz: f32cf482c8887ae1710b026973a5213e3a54fd08d1d20a3785787e88a9846649
5
5
  SHA512:
6
- metadata.gz: 7e3606a15f01ce5f49f124fe1dfa7ba08cd9f77bd41ca33dc8cd7b1bfacbb841d9cf4ca6e113252fb13096aa093d0ea8dd91513b3fba7a10a30d4e9100ff781a
7
- data.tar.gz: 4d319ceea262f9ce4a6c7ff96ea94766bad936578e4436cc5efcdf1598ce1d7802da15bd163d53827487110cce1428835451869fcfa7e0c9401e7caeee0ac431
6
+ metadata.gz: ec45ceaa034479c334e8ae7865ec844da5422d0598b223985c4c9ce2734eb5c1d67f104bcebcc3d6a41ad46ee78a1f1ab441ec1cdee19ae86b1f535cfc646430
7
+ data.tar.gz: b1b010a0366ac54aeaa48ecef92926415e10a2d7a903e66790a324b61ddcbefeeedd41901b59b826419df834f0f677b1963b0a5c76088b0d14edf8e91fb765f2
data/Gemfile CHANGED
@@ -2,7 +2,13 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- group :test, :development do
5
+ group :docs do
6
+ gem "yard"
7
+ gem "redcarpet"
8
+ gem "github-markup"
9
+ end
10
+
11
+ group :test do
6
12
  gem "rake"
7
13
  gem "rspec"
8
14
  gem "vcr"
@@ -19,8 +25,15 @@ if RUBY_VERSION =~ /^2/
19
25
  end
20
26
  end
21
27
 
28
+ group :development do
29
+ gem "pry"
30
+ gem "pry-byebug"
31
+ gem "pry-stack_explorer"
32
+ gem "rb-readline"
33
+ end
34
+
22
35
  instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]
23
36
 
24
37
  # If you want to load debugging tools into the bundle exec sandbox,
25
38
  # add these additional dependencies into Gemfile.local
26
- eval(IO.read(__FILE__ + ".local"), binding) if File.exist?(__FILE__ + ".local")
39
+ eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local")
data/Rakefile CHANGED
@@ -14,18 +14,13 @@ end
14
14
  begin
15
15
  require "chefstyle"
16
16
  require "rubocop/rake_task"
17
- RuboCop::RakeTask.new(:chefstyle) do |task|
18
- task.options << "--display-cop-names"
17
+ RuboCop::RakeTask.new(:style) do |task|
18
+ task.options += ["--display-cop-names", "--no-color"]
19
19
  end
20
20
  rescue LoadError
21
21
  puts "chefstyle gem is not installed"
22
22
  end
23
23
 
24
- namespace :travis do
25
- desc "Run tests on Travis CI"
26
- task ci: %w{chefstyle unit functional}
27
- end
28
-
29
24
  desc "Render product matrix documentation"
30
25
  task "matrix" do
31
26
  require "mixlib/install/product"
@@ -45,6 +40,13 @@ task "matrix" do
45
40
  end
46
41
  end
47
42
 
43
+ begin
44
+ require "yard"
45
+ YARD::Rake::YardocTask.new(:docs)
46
+ rescue LoadError
47
+ puts "yard is not available. bundle install first to make sure all dependencies are installed."
48
+ end
49
+
48
50
  task :console do
49
51
  require "irb"
50
52
  require "irb/completion"
@@ -53,4 +55,4 @@ task :console do
53
55
  IRB.start
54
56
  end
55
57
 
56
- task default: %w{travis:ci}
58
+ task default: %w{style unit functional}
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Thom May (<thom@chef.io>)
3
3
  # Author:: Patrick Wright (<patrick@chef.io>)
4
- # Copyright:: Copyright (c) 2015 Chef, Inc.
4
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Patrick Wright (<patrick@chef.io>)
3
- # Copyright:: Copyright (c) 2015 Chef, Inc.
3
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Patrick Wright (<patrick@chef.io>)
3
- # Copyright:: Copyright (c) 2015 Chef, Inc.
3
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Patrick Wright (<patrick@chef.io>)
3
- # Copyright:: Copyright (c) 2016 Chef, Inc.
3
+ # Copyright:: Copyright (c) 2016-2018 Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -174,19 +174,12 @@ EOF
174
174
  artifact_64 = artifacts.find { |a| a.platform == "windows" && a.architecture == "x86_64" }
175
175
  artifact_32 = artifacts.find { |a| a.platform == "windows" && a.architecture == "i386" }
176
176
 
177
- # Attempt to clone windows artifacts only when a Windows 32 bit artifact exists
178
- if artifact_32
179
- new_artifacts.concat(clone_windows_desktop_artifacts(artifact_32))
180
-
181
- # Clone an existing 64 bit artifact
182
- if artifact_64
183
- new_artifacts.concat(clone_windows_desktop_artifacts(artifact_64))
184
-
185
- # Clone the 32 bit artifact when 64 bit doesn't exist
186
- else
187
- new_artifacts.concat(clone_windows_desktop_artifacts(artifact_32, architecture: "x86_64"))
188
- end
189
- end
177
+ # Clone an existing 64-bit artifact
178
+ new_artifacts.concat(clone_windows_desktop_artifacts(artifact_64)) if artifact_64
179
+ # Clone an existing 32-bit artifact
180
+ new_artifacts.concat(clone_windows_desktop_artifacts(artifact_32)) if artifact_32
181
+ # Clone the 32 bit artifact when 64 bit doesn't exist
182
+ new_artifacts.concat(clone_windows_desktop_artifacts(artifact_32, architecture: "x86_64")) if artifact_32 && !artifact_64
190
183
 
191
184
  # Now discard the cloned artifacts if we find an equivalent native
192
185
  # artifact
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Patrick Wright (<patrick@chef.io>)
3
- # Copyright:: Copyright (c) 2015-2016 Chef, Inc.
3
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,3 +1,17 @@
1
+ #
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ #
14
+
1
15
  require "mixlib/install"
2
16
  require "thor"
3
17
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2015 Chef, Inc.
2
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2015 Chef, Inc.
2
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2015 Chef, Inc.
2
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  # fetch_package.sh
2
2
  ############
3
- # This section fetchs a package from $download_url and verifies its metadata.
3
+ # This section fetches a package from $download_url and verifies its metadata.
4
4
  #
5
5
  # Inputs:
6
6
  # $download_url:
@@ -26,7 +26,7 @@ else
26
26
  download_filename="$tmp_dir/$filename"
27
27
  fi
28
28
 
29
- # ensure the parent directory where to download the installer always exists
29
+ # ensure the parent directory where we download the installer always exists
30
30
  download_dir=`dirname $download_filename`
31
31
  (umask 077 && mkdir -p $download_dir) || exit 1
32
32
 
@@ -4,7 +4,7 @@
4
4
  # - must run on /bin/sh on solaris 9
5
5
  # - must run on /bin/sh on AIX 6.x
6
6
  #
7
- # Copyright:: Copyright (c) 2010-2015 Chef Software, Inc.
7
+ # Copyright:: Copyright (c) 2010-2018 Chef Software, Inc.
8
8
  # License:: Apache License, Version 2.0
9
9
  #
10
10
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -326,7 +326,7 @@ if test "x$TMPDIR" = "x"; then
326
326
  else
327
327
  tmp=$TMPDIR
328
328
  fi
329
- # secure-ish temp dir creation without having mktemp available (DDoS-able but not expliotable)
329
+ # secure-ish temp dir creation without having mktemp available (DDoS-able but not exploitable)
330
330
  tmp_dir="$tmp/install.sh.$$"
331
331
  (umask 077 && mkdir $tmp_dir) || exit 1
332
332
 
@@ -12,7 +12,7 @@ if test "x$version" = "x" -a "x$CI" != "xtrue"; then
12
12
  echo
13
13
  echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
14
14
  echo
15
- echo "You are installing an omnibus package without a version pin. If you are installing"
15
+ echo "You are installing a package without a version pin. If you are installing"
16
16
  echo "on production servers via an automated process this is DANGEROUS and you will"
17
17
  echo "be upgraded without warning on new releases, even to new major releases."
18
18
  echo "Letting the version float is only appropriate in desktop, test, development or"
@@ -12,9 +12,9 @@
12
12
  #
13
13
  # Platform and Platform Version detection
14
14
  #
15
- # NOTE: This should now match ohai platform and platform_version matching.
16
- # do not invented new platform and platform_version schemas, just make this behave
17
- # like what ohai returns as platform and platform_version for the server.
15
+ # NOTE: This logic should match ohai platform and platform_version matching.
16
+ # do not invent new platform and platform_version schemas, just make this behave
17
+ # like what ohai returns as platform and platform_version for the system.
18
18
  #
19
19
  # ALSO NOTE: Do not mangle platform or platform_version here. It is less error
20
20
  # prone and more future-proof to do that in the server, and then all omnitruck clients
@@ -97,7 +97,7 @@ elif test -f "/etc/SuSE-release"; then
97
97
  platform="sles"
98
98
  platform_version=`awk '/^VERSION/ {V = $3}; /^PATCHLEVEL/ {P = $3}; END {print V "." P}' /etc/SuSE-release`
99
99
  else
100
- platform="suse"
100
+ platform="opensuseleap"
101
101
  platform_version=`awk '/^VERSION =/ { print $3 }' /etc/SuSE-release`
102
102
  fi
103
103
  elif test "x$os" = "xFreeBSD"; then
@@ -124,7 +124,7 @@ if test "x$platform" = "x"; then
124
124
  fi
125
125
 
126
126
  #
127
- # NOTE: platform manging in the install.sh is DEPRECATED
127
+ # NOTE: platform mangling in the install.sh is DEPRECATED
128
128
  #
129
129
  # - install.sh should be true to ohai and should not remap
130
130
  # platform or platform versions.
@@ -156,7 +156,7 @@ case $platform in
156
156
  "sles")
157
157
  platform_version=$major_version
158
158
  ;;
159
- "suse")
159
+ "opensuseleap")
160
160
  platform_version=$major_version
161
161
  ;;
162
162
  esac
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2015 Chef, Inc.
2
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Patrick Wright (<patrick@chef.io>)
3
- # Copyright:: Copyright (c) 2015 Chef, Inc.
3
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2015 Chef, Inc.
2
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Thom May (<thom@chef.io>)
3
3
  # Author:: Patrick Wright (<patrick@chef.io>)
4
- # Copyright:: Copyright (c) 2015 Chef, Inc.
4
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Thom May (<thom@chef.io>)
3
- # Copyright:: Copyright (c) 2015 Chef, Inc.
3
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "3.11.5"
3
+ VERSION = "3.11.11"
4
4
  end
5
5
  end
@@ -11,9 +11,9 @@ Gem::Specification.new do |spec|
11
11
  spec.license = "Apache-2.0"
12
12
 
13
13
  spec.summary = "A library for interacting with Chef Software Inc's software distribution systems."
14
- spec.homepage = "https://chef.io"
14
+ spec.homepage = "https://github.com/chef/mixlib-install"
15
15
 
16
- spec.files = %w{LICENSE PRODUCT_MATRIX.md README.md Gemfile Rakefile} + Dir.glob("*.gemspec") + Dir.glob("{bin,lib,support}/**/*")
16
+ spec.files = %w{LICENSE Gemfile Rakefile} + Dir.glob("*.gemspec") + Dir.glob("{bin,lib,support}/**/*")
17
17
  spec.executables = ["mixlib-install"]
18
18
  spec.require_paths = ["lib"]
19
19
 
@@ -65,7 +65,7 @@ Function Verify-SHA256($path, $sha256) {
65
65
  }
66
66
 
67
67
  Function Install-Chef($msi, $chef_omnibus_root) {
68
- Log "Installing Chef Omnibus package $msi"
68
+ Log "Installing Chef package $msi"
69
69
  $installingChef = $True
70
70
  $installAttempts = 0
71
71
  while ($installingChef) {
@@ -194,7 +194,7 @@ Function Unresolve-Path($p) {
194
194
  $chef_omnibus_root = Unresolve-Path $chef_omnibus_root
195
195
 
196
196
  if (Check-UpdateChef $chef_omnibus_root $version) {
197
- Write-Host "-----> Installing Chef Omnibus ($pretty_version)"
197
+ Write-Host "-----> Installing Chef $pretty_version package"
198
198
  if ($chef_metadata_url -ne $null) {
199
199
  $url, $sha256 = Get-ChefMetadata "$chef_metadata_url"
200
200
  } else {
@@ -210,5 +210,5 @@ if (Check-UpdateChef $chef_omnibus_root $version) {
210
210
  }
211
211
  Install-Chef $msi $chef_omnibus_root
212
212
  } else {
213
- Write-Host "-----> Chef Omnibus installation detected ($pretty_version)"
213
+ Write-Host "-----> Chef installation detected ($pretty_version)"
214
214
  }
@@ -206,7 +206,7 @@ unable_to_download() {
206
206
  main() {
207
207
  should_update_chef "$chef_omnibus_root" "$version"
208
208
  if test $? -eq 0; then
209
- echo "-----> Installing Chef Omnibus (${pretty_version})";
209
+ echo "-----> Installing Chef ${pretty_version} package";
210
210
 
211
211
  # solaris 10 lacks recent enough credentials, so http url is used
212
212
  platform="`/usr/bin/uname -s 2>/dev/null`";
@@ -218,7 +218,7 @@ main() {
218
218
  do_download "$chef_omnibus_url" /tmp/install.sh;
219
219
  $sudo_sh /tmp/install.sh $install_flags;
220
220
  else
221
- echo "-----> Chef Omnibus installation detected (${pretty_version})";
221
+ echo "-----> Chef installation detected (${pretty_version})";
222
222
  fi
223
223
  }
224
224
 
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.11.5
4
+ version: 3.11.11
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: 2018-08-08 00:00:00.000000000 Z
12
+ date: 2019-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mixlib-shellout
@@ -64,8 +64,6 @@ extra_rdoc_files: []
64
64
  files:
65
65
  - Gemfile
66
66
  - LICENSE
67
- - PRODUCT_MATRIX.md
68
- - README.md
69
67
  - Rakefile
70
68
  - bin/mixlib-install
71
69
  - lib/mixlib/install.rb
@@ -98,7 +96,7 @@ files:
98
96
  - mixlib-install.gemspec
99
97
  - support/install_command.ps1
100
98
  - support/install_command.sh
101
- homepage: https://chef.io
99
+ homepage: https://github.com/chef/mixlib-install
102
100
  licenses:
103
101
  - Apache-2.0
104
102
  metadata: {}
data/PRODUCT_MATRIX.md DELETED
@@ -1,28 +0,0 @@
1
- | Product | Product Key |
2
- | ------- | ------------ |
3
- | Analytics Platform | analytics |
4
- | Angry Omnibus Toolchain | angry-omnibus-toolchain |
5
- | Angry Chef Client | angrychef |
6
- | Chef Automate | automate |
7
- | Chef Client | chef |
8
- | Chef Backend | chef-backend |
9
- | Chef Server | chef-server |
10
- | Chef Server HA Provisioning for AWS | chef-server-ha-provisioning |
11
- | Chef Workstation | chef-workstation |
12
- | Chef Development Kit | chefdk |
13
- | Chef Compliance | compliance |
14
- | Delivery | delivery |
15
- | Chef Server High Availability addon | ha |
16
- | Harmony - Omnibus Integration Internal Test Project | harmony |
17
- | InSpec | inspec |
18
- | Management Console | manage |
19
- | Chef Cloud Marketplace addon | marketplace |
20
- | Omnibus Toolchain | omnibus-toolchain |
21
- | Enterprise Chef (legacy) | private-chef |
22
- | Chef Push Client | push-jobs-client |
23
- | Chef Push Server | push-jobs-server |
24
- | Chef Server Reporting addon | reporting |
25
- | Supermarket | supermarket |
26
- | Chef Server Replication addon | sync |
27
-
28
- Do not modify this file manually. It is automatically rendered via a rake task.
data/README.md DELETED
@@ -1,258 +0,0 @@
1
- [![Build Status](https://travis-ci.org/chef/mixlib-install.svg?branch=master)](https://travis-ci.org/chef/mixlib-install)
2
-
3
- # Mixlib::Install
4
-
5
- ## Supports
6
-
7
- - Ruby 1.9.3+
8
- - Chef 11.6.2+ chef-client upgrades
9
-
10
- ## Command Line Usage
11
- ```
12
- $ gem install mixlib-install
13
- ```
14
-
15
- ```
16
- # Download latest stable chef for current platform
17
- $ mixlib-install download chef
18
- ```
19
-
20
- Run `$ mixlib-install help` for additional commands and options.
21
-
22
- ## API Usage
23
-
24
- ### Load mixlib-install
25
- ```ruby
26
- require 'mixlib/install'
27
- ```
28
-
29
- ### Get URL for specific platform and package version
30
- ```ruby
31
- options = {
32
- channel: :current,
33
- product_name: 'chef',
34
- product_version: :latest,
35
- platform: 'mac_os_x',
36
- platform_version: '10.9',
37
- architecture: 'x86_64'
38
- }
39
-
40
- artifact = Mixlib::Install.new(options).artifact_info
41
- # => #<Mixlib::Install::ArtifactInfo>
42
-
43
- artifact.url
44
- # => "https://packages.chef.io/files/current/chef/12.14.90/mac_os_x/10.9/chef-12.14.90-1.dmg"
45
- ```
46
-
47
- ### Get list of artifacts for all platforms given a package version
48
- ```ruby
49
- options = {
50
- channel: :current,
51
- product_name: 'chef'
52
- }
53
- # product_version: :latest is the default
54
-
55
- artifacts = Mixlib::Install.new(options).artifact_info
56
- # => [#<Mixlib::Install::ArtifactInfo>, ...]
57
-
58
- artifacts.first.url
59
- # => => "https://packages.chef.io/files/current/chef/12.14.90/mac_os_x/10.11/chef-12.14.90-1.dmg"
60
- ```
61
-
62
- ### Get latest artifacts for a partial version
63
- ```ruby
64
- options = {
65
- channel: :current,
66
- product_name: 'chef',
67
- product_version: '12.14'
68
- }
69
-
70
- artifacts = Mixlib::Install.new(options).artifact_info
71
- # => [#<Mixlib::Install::ArtifactInfo>]
72
-
73
- artifacts.first.version
74
- # => "12.14.89"
75
- ```
76
-
77
- ### Get latest artifact for a partial version
78
- ```ruby
79
- options = {
80
- channel: :current,
81
- product_name: 'chef',
82
- product_version: '12',
83
- platform: 'mac_os_x',
84
- platform_version: '10.9',
85
- architecture: 'x86_64'
86
- }
87
-
88
- artifact = Mixlib::Install.new(options).artifact_info
89
- # => #<Mixlib::Install::ArtifactInfo>
90
-
91
- artifact.version
92
- # => "12.19.36"
93
- ```
94
-
95
- ### Detect platform information
96
- ```ruby
97
- options = {
98
- channel: :current,
99
- product_name: 'chef',
100
- product_version: :latest
101
- }
102
-
103
- artifact = Mixlib::Install.new(options).detect_platform
104
-
105
- artifact.platform # => "mac_os_x"
106
- artifact.platform_version # => "10.10"
107
- ```
108
-
109
- ### Use an artifact released for an earlier version of the platform
110
- ```ruby
111
- options = {
112
- channel: :current,
113
- product_name: 'chef',
114
- product_version: :latest,
115
- platform: 'ubuntu',
116
- platform_version: '15.04',
117
- architecture: 'x86_64',
118
- platform_version_compatibility_mode: true
119
- }
120
-
121
- artifact = Mixlib::Install.new(options).artifact_info
122
-
123
- artifact.platform # => "ubuntu"
124
- artifact.platform_version # => "14.04"
125
- ```
126
-
127
- `platform_version_compatibility_mode` will automatically be enabled if platform options are not specified.
128
-
129
- If running on Ubuntu 15.04...
130
- ```ruby
131
- options = {
132
- channel: :current,
133
- product_name: 'chef',
134
- }
135
-
136
- artifact = Mixlib::Install.new(options).artifact_info
137
-
138
- artifact.platform # => "ubuntu"
139
- artifact.platform_version # => "14.04"
140
- ```
141
-
142
- ### List the available versions for a product and channel
143
- #### Instance method
144
- ```ruby
145
- options = {
146
- channel: :stable,
147
- product_name: 'chef',
148
- }
149
-
150
- Mixlib::Install.new(options).available_versions
151
-
152
- # => ["12.13.3", "12.13.7"]
153
- ```
154
-
155
- #### Class method
156
- ```ruby
157
- Mixlib::Install.available_versions("chef", "stable")
158
-
159
- # => ["12.13.3", "12.13.7"]
160
- ```
161
-
162
- ### Download an artifact
163
- Download a specific artifact to a configurable location. All platform options (platform, platform_version, architecture) are required in order to filter a single artifact.
164
- ```ruby
165
- # detect platform and download to the operating system’s temporary file path
166
- Mixlib::Install.new(product_name: "chefdk", channel: :stable).detect_platform.download_artifact(Dir.tmpdir)
167
- # => "/tmp/chefdk-2.3.4-1.deb"
168
-
169
- # specify platform options and download to current directory
170
- Mixlib::Install.new(product_name: "chefdk", channel: :stable, platform: "ubuntu", platform_version: "14.04", architecture: "x86_64").download_artifact
171
- # => "~/chefdk-2.3.4-1.deb"
172
-
173
- ```
174
-
175
- ### User-Agent Request Headers
176
- By default, all requests made by `mixlib-install` will include a `User-Agent` request header as `mixlib-install/<version>`.
177
- Additional `User-Agent` request headers can be added by setting the `user_agent_headers` option.
178
- When you want to identify a product using mixlib-install as a dependency we recommend the format `product/version`.
179
- ```ruby
180
- options = {
181
- channel: :stable,
182
- product_name: 'chef',
183
- user_agent_headers: ["my_product/1.2.3", "somethingelse"],
184
- }
185
- ```
186
-
187
- ### Collecting Software Dependencies and License Content
188
- Collecting software dependencies and license content for ArtifactInfo instances
189
- requires additional requests to the repository server. By default, collection is disabled.
190
- To return data for instance methods `software_dependencies` and `license_content`, the `include_metadata` option must be enabled.
191
- ```ruby
192
- options = {
193
- channel: :current,
194
- product_name: 'chef',
195
- product_version: :latest,
196
- platform: 'mac_os_x',
197
- platform_version: '10.9',
198
- architecture: 'x86_64',
199
- include_metadata: true,
200
- }
201
-
202
- artifact = Mixlib::Install.new(options).artifact_info
203
-
204
- artifact.license_content.class
205
- # => String
206
- artifact.software_dependencies.class
207
- # => Hash
208
-
209
- # By default, the instance methods return nil
210
-
211
- ```
212
-
213
-
214
- ### Install Scripts
215
- mixlib-install generates the bootstrap installation scripts known as install.sh and install.ps1. The associated install script will be returned when calling `#install_command` on the Mixlib::Install instance.
216
-
217
- Mixlib::Install instantiation option `install_command_options` can accept variables (bourne) or parameters (powershell) to modify the behavior of the install scripts.
218
-
219
- Some of the more common options include:
220
-
221
- `download_url_override`: Use the provided URL instead of fetching the metadata URL from Chef Software Inc's software distribution systems.
222
- `checksum`: SHA256 value associated to the directed file for the download_url_override option. This setting is optional. Not setting this will download the file even if a cached file is detected.
223
- `install_strategy`: Set to "once" to have the script exit if the product being installed is detected.
224
-
225
- ```ruby
226
- options = {
227
- product_name: 'chef',
228
- install_command_options: {
229
- download_url_override: "https://file/path",
230
- checksum: "OPTIONAL",
231
- install_strategy: "once",
232
- }
233
- }
234
-
235
- Mixlib::Install.new(options).install_command
236
- ```
237
-
238
- #### Proxies
239
- The API uses Ruby's OpenURI module to load proxy environment variables (`http_proxy`, `https_proxy`, `ftp_proxy`, `no_proxy`).
240
-
241
- When `install.sh` and `install.ps1` are executed as standalone scripts the will rely on environment variables to configure proxy settings. The install scripts will not configure proxy settings by default.
242
-
243
- In order to customize the proxy environment variables for generated install scripts they must be set by the `install_command_options` option. Setting these options will override session environment variables.
244
-
245
- Bourne install script (`install.sh`) supports `http_proxy`, `https_proxy`, `ftp_proxy`, and `no_proxy` passed as keys to `install_command_options`.
246
-
247
- Powershell install script (`install.ps1`) supports `http_proxy` passed as a key to `install_command_options`.
248
-
249
- ## Development
250
- VCR is a tool that helps cache and replay http responses. When these responses change or when you add more tests you might need to update cached responses. Check out [spec_helper.rb](https://github.com/chef/mixlib-install/blob/master/spec/spec_helper.rb) for instructions on how to do this.
251
-
252
- ## Contributing
253
-
254
- 1. Fork it ( https://github.com/[my-github-username]/mixlib-install/fork )
255
- 2. Create your feature branch (`git checkout -b my-new-feature`)
256
- 3. Commit your changes (`git commit -am 'Add some feature'`)
257
- 4. Push to the branch (`git push origin my-new-feature`)
258
- 5. Create a new Pull Request