wjordan-mixlib-install 0.8.0.alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.rubocop.yml +10 -0
- data/.travis.yml +8 -0
- data/CONTRIBUTING.md +14 -0
- data/Gemfile +5 -0
- data/LICENSE +201 -0
- data/PRODUCT_MATRIX.md +24 -0
- data/README.md +55 -0
- data/Rakefile +53 -0
- data/acceptance/.gitignore +2 -0
- data/acceptance/Gemfile +12 -0
- data/acceptance/current/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/current/.acceptance/acceptance-cookbook/metadata.rb +1 -0
- data/acceptance/current/.acceptance/acceptance-cookbook/recipes/destroy.rb +3 -0
- data/acceptance/current/.acceptance/acceptance-cookbook/recipes/provision.rb +3 -0
- data/acceptance/current/.acceptance/acceptance-cookbook/recipes/verify.rb +3 -0
- data/acceptance/current/.kitchen.yml +41 -0
- data/acceptance/unstable/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/unstable/.acceptance/acceptance-cookbook/metadata.rb +1 -0
- data/acceptance/unstable/.acceptance/acceptance-cookbook/recipes/destroy.rb +3 -0
- data/acceptance/unstable/.acceptance/acceptance-cookbook/recipes/provision.rb +3 -0
- data/acceptance/unstable/.acceptance/acceptance-cookbook/recipes/verify.rb +3 -0
- data/acceptance/unstable/.kitchen.yml +41 -0
- data/lib/mixlib/install/artifact_info.rb +76 -0
- data/lib/mixlib/install/backend/artifactory.rb +214 -0
- data/lib/mixlib/install/backend/omnitruck.rb +76 -0
- data/lib/mixlib/install/backend.rb +36 -0
- data/lib/mixlib/install/generator/base.rb +65 -0
- data/lib/mixlib/install/generator/bourne/scripts/artifactory_urls.sh.erb +31 -0
- data/lib/mixlib/install/generator/bourne/scripts/fetch_metadata.sh.erb +48 -0
- data/lib/mixlib/install/generator/bourne/scripts/fetch_package.sh +53 -0
- data/lib/mixlib/install/generator/bourne/scripts/helpers.sh +340 -0
- data/lib/mixlib/install/generator/bourne/scripts/install_package.sh +33 -0
- data/lib/mixlib/install/generator/bourne/scripts/platform_detection.sh +165 -0
- data/lib/mixlib/install/generator/bourne/scripts/script_cli_parameters.sh +36 -0
- data/lib/mixlib/install/generator/bourne.rb +71 -0
- data/lib/mixlib/install/generator/powershell/scripts/get_project_metadata.ps1.erb +96 -0
- data/lib/mixlib/install/generator/powershell/scripts/get_project_metadata_for_artifactory.ps1.erb +92 -0
- data/lib/mixlib/install/generator/powershell/scripts/helpers.ps1 +69 -0
- data/lib/mixlib/install/generator/powershell/scripts/install_project.ps1 +99 -0
- data/lib/mixlib/install/generator/powershell.rb +94 -0
- data/lib/mixlib/install/generator.rb +33 -0
- data/lib/mixlib/install/options.rb +152 -0
- data/lib/mixlib/install/product.rb +288 -0
- data/lib/mixlib/install/script_generator.rb +217 -0
- data/lib/mixlib/install/util.rb +124 -0
- data/lib/mixlib/install/version.rb +5 -0
- data/lib/mixlib/install.rb +124 -0
- data/mixlib-install.gemspec +27 -0
- data/support/install_command.ps1 +84 -0
- data/support/install_command.sh +229 -0
- metadata +185 -0
@@ -0,0 +1,124 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Thom May (<thom@chef.io>)
|
3
|
+
# Author:: Patrick Wright (<patrick@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2015 Chef, Inc.
|
5
|
+
# License:: Apache License, Version 2.0
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require "mixlib/versioning"
|
21
|
+
|
22
|
+
require "mixlib/install/backend"
|
23
|
+
require "mixlib/install/options"
|
24
|
+
require "mixlib/install/generator"
|
25
|
+
require "mixlib/install/generator/bourne"
|
26
|
+
require "mixlib/install/generator/powershell"
|
27
|
+
|
28
|
+
module Mixlib
|
29
|
+
class Install
|
30
|
+
|
31
|
+
attr_reader :options
|
32
|
+
|
33
|
+
def initialize(options = {})
|
34
|
+
@options = Options.new(options)
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Fetch artifact metadata information
|
39
|
+
#
|
40
|
+
# @return [ArtifactInfo] fetched artifact data
|
41
|
+
#
|
42
|
+
def artifact_info
|
43
|
+
Backend.info(options)
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Returns an install script for the given options
|
48
|
+
#
|
49
|
+
# @return [String] script for installing with given options
|
50
|
+
#
|
51
|
+
def install_command
|
52
|
+
Generator.install_command(options)
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Returns the base installation directory for the given options
|
57
|
+
#
|
58
|
+
# @return [String] the installation directory for the project
|
59
|
+
#
|
60
|
+
def root
|
61
|
+
# This only works for chef and chefdk but they are the only projects
|
62
|
+
# we are supporting as of now.
|
63
|
+
if options.for_ps1?
|
64
|
+
"$env:systemdrive\\opscode\\#{options.product_name}"
|
65
|
+
else
|
66
|
+
"/opt/#{options.product_name}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
#
|
71
|
+
# Returns the current version of the installed product.
|
72
|
+
# Returns nil if the product is not installed.
|
73
|
+
#
|
74
|
+
def current_version
|
75
|
+
# Note that this logic does not work for products other than
|
76
|
+
# chef & chefdk since version-manifest is created under the
|
77
|
+
# install directory which can be different than the product name (e.g.
|
78
|
+
# chef-server -> /opt/opscode). But this is OK for now since
|
79
|
+
# chef & chefdk are the only supported products.
|
80
|
+
version_manifest_file = if options.for_ps1?
|
81
|
+
"$env:systemdrive\\opscode\\#{options.product_name}\\version-manifest.json"
|
82
|
+
else
|
83
|
+
"/opt/#{options.product_name}/version-manifest.json"
|
84
|
+
end
|
85
|
+
|
86
|
+
if File.exist? version_manifest_file
|
87
|
+
JSON.parse(File.read(version_manifest_file))["build_version"]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
#
|
92
|
+
# Returns true if an upgradable version is available, false otherwise.
|
93
|
+
#
|
94
|
+
def upgrade_available?
|
95
|
+
return true if current_version.nil?
|
96
|
+
|
97
|
+
available_ver = Mixlib::Versioning.parse(artifact_info.first.version)
|
98
|
+
current_ver = Mixlib::Versioning.parse(current_version)
|
99
|
+
(available_ver > current_ver)
|
100
|
+
end
|
101
|
+
|
102
|
+
#
|
103
|
+
# Returns the install.sh script
|
104
|
+
# Supported context parameters:
|
105
|
+
# ------------------
|
106
|
+
# base_url [String]
|
107
|
+
# url pointing to the omnitruck to be queried by the script.
|
108
|
+
#
|
109
|
+
def self.install_sh(context = {})
|
110
|
+
Mixlib::Install::Generator::Bourne.install_sh(context)
|
111
|
+
end
|
112
|
+
|
113
|
+
#
|
114
|
+
# Returns the install.ps1 script
|
115
|
+
# Supported context parameters:
|
116
|
+
# ------------------
|
117
|
+
# base_url [String]
|
118
|
+
# url pointing to the omnitruck to be queried by the script.
|
119
|
+
#
|
120
|
+
def self.install_ps1(context = {})
|
121
|
+
Mixlib::Install::Generator::PowerShell.install_ps1(context)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "mixlib/install/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "wjordan-mixlib-install"
|
8
|
+
spec.version = Mixlib::Install::VERSION
|
9
|
+
spec.authors = ["Will Jordan", "Thom May", "Patrick Wright"]
|
10
|
+
spec.email = ["will@code.org", "thom@chef.io", "patrick@chef.io"]
|
11
|
+
spec.license = "Apache-2.0"
|
12
|
+
|
13
|
+
spec.summary = "A mixin to help with omnitruck installs (edge fork)"
|
14
|
+
spec.homepage = "https://chef.io"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency "artifactory", "~> 2.3.0"
|
21
|
+
spec.add_dependency "mixlib-versioning", "~> 1.1.0"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.3"
|
26
|
+
spec.add_development_dependency "pry"
|
27
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
Function Check-UpdateChef($root, $version) {
|
2
|
+
if (-Not (Test-Path $root)) { return $true }
|
3
|
+
elseif ("$version" -eq "true") { return $false }
|
4
|
+
elseif ("$version" -eq "latest") { return $true }
|
5
|
+
|
6
|
+
Try { $chef_version = (Get-Content $root\version-manifest.txt | select-object -first 1) }
|
7
|
+
Catch {
|
8
|
+
Try { $chef_version = (& $root\bin\chef-solo.bat -v) }
|
9
|
+
Catch { $chef_version = " " }
|
10
|
+
}
|
11
|
+
|
12
|
+
if ($chef_version.split(" ", 2)[1].StartsWith($version)) { return $false }
|
13
|
+
else { return $true }
|
14
|
+
}
|
15
|
+
|
16
|
+
Function Get-ChefMetadata($url) {
|
17
|
+
Try { $response = ($c = Make-WebClient).DownloadString($url) }
|
18
|
+
Finally { if ($c -ne $null) { $c.Dispose() } }
|
19
|
+
|
20
|
+
$md = ConvertFrom-StringData $response.Replace("`t", "=")
|
21
|
+
return @($md.url, $md.md5)
|
22
|
+
}
|
23
|
+
|
24
|
+
Function Get-MD5Sum($src) {
|
25
|
+
Try {
|
26
|
+
$c = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
|
27
|
+
$bytes = $c.ComputeHash(($in = (Get-Item $src).OpenRead()))
|
28
|
+
return ([System.BitConverter]::ToString($bytes)).Replace("-", "").ToLower()
|
29
|
+
} Finally { if (($c -ne $null) -and ($c.GetType().GetMethod("Dispose") -ne $null)) { $c.Dispose() }; if ($in -ne $null) { $in.Dispose() } }
|
30
|
+
}
|
31
|
+
|
32
|
+
Function Download-Chef($url, $md5, $dst) {
|
33
|
+
Try {
|
34
|
+
Log "Downloading package from $url"
|
35
|
+
($c = Make-WebClient).DownloadFile($url, $dst)
|
36
|
+
Log "Download complete."
|
37
|
+
} Finally { if ($c -ne $null) { $c.Dispose() } }
|
38
|
+
|
39
|
+
if ($md5 -eq $null) { Log "Skipping md5 verification" }
|
40
|
+
elseif (($dmd5 = Get-MD5Sum $dst) -eq $md5) { Log "Successfully verified $dst" }
|
41
|
+
else { throw "MD5 for $dst $dmd5 does not match $md5" }
|
42
|
+
}
|
43
|
+
|
44
|
+
Function Install-Chef($msi) {
|
45
|
+
Log "Installing Chef Omnibus package $msi"
|
46
|
+
$p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /i $msi" -Passthru -Wait
|
47
|
+
|
48
|
+
if ($p.ExitCode -ne 0) { throw "msiexec was not successful. Received exit code $($p.ExitCode)" }
|
49
|
+
|
50
|
+
Remove-Item $msi -Force
|
51
|
+
Log "Installation complete"
|
52
|
+
}
|
53
|
+
|
54
|
+
Function Log($m) { Write-Host " $m`n" }
|
55
|
+
|
56
|
+
Function Make-WebClient {
|
57
|
+
$proxy = New-Object -TypeName System.Net.WebProxy
|
58
|
+
$proxy.Address = $env:http_proxy
|
59
|
+
$client = New-Object -TypeName System.Net.WebClient
|
60
|
+
$client.Proxy = $proxy
|
61
|
+
return $client
|
62
|
+
}
|
63
|
+
|
64
|
+
Function Unresolve-Path($p) {
|
65
|
+
if ($p -eq $null) { return $null }
|
66
|
+
else { return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($p) }
|
67
|
+
}
|
68
|
+
|
69
|
+
$chef_omnibus_root = Unresolve-Path $chef_omnibus_root
|
70
|
+
$msi = Unresolve-Path $msi
|
71
|
+
|
72
|
+
if (Check-UpdateChef $chef_omnibus_root $version) {
|
73
|
+
Write-Host "-----> Installing Chef Omnibus ($pretty_version)`n"
|
74
|
+
if ($chef_metadata_url -ne $null) {
|
75
|
+
$url, $md5 = Get-ChefMetadata "$chef_metadata_url"
|
76
|
+
} else {
|
77
|
+
$url = $chef_msi_url
|
78
|
+
$md5 = $null
|
79
|
+
}
|
80
|
+
Download-Chef "$url" $md5 $msi
|
81
|
+
Install-Chef $msi
|
82
|
+
} else {
|
83
|
+
Write-Host "-----> Chef Omnibus installation detected ($pretty_version)`n"
|
84
|
+
}
|
@@ -0,0 +1,229 @@
|
|
1
|
+
tmp_stderr="/tmp/stderr";
|
2
|
+
|
3
|
+
# capture_tmp_stderr SOURCE
|
4
|
+
capture_tmp_stderr() {
|
5
|
+
# spool up $tmp_stderr from all the commands we called
|
6
|
+
if test -f "$tmp_stderr"; then
|
7
|
+
output="`cat $tmp_stderr`";
|
8
|
+
stderr_results="${stderr_results}\nSTDERR from $1:\n\n${output}\n";
|
9
|
+
rm $tmp_stderr;
|
10
|
+
fi
|
11
|
+
}
|
12
|
+
|
13
|
+
# do_curl URL FILENAME
|
14
|
+
do_curl() {
|
15
|
+
echo "Trying curl...";
|
16
|
+
curl -sL -D "$tmp_stderr" "$1" > "$2";
|
17
|
+
ec=$?;
|
18
|
+
# check for 404
|
19
|
+
grep "404 Not Found" "$tmp_stderr" 2>&1 >/dev/null;
|
20
|
+
if test $? -eq 0; then
|
21
|
+
http_404_error "$1";
|
22
|
+
fi
|
23
|
+
|
24
|
+
# check for bad return status or empty output
|
25
|
+
if test $ec -ne 0 || test ! -s "$2"; then
|
26
|
+
capture_tmp_stderr "curl";
|
27
|
+
return 1;
|
28
|
+
else
|
29
|
+
echo "Download complete.";
|
30
|
+
return 0;
|
31
|
+
fi
|
32
|
+
}
|
33
|
+
|
34
|
+
# do_download URL FILENAME
|
35
|
+
do_download() {
|
36
|
+
echo "Downloading ${1} to file ${2}";
|
37
|
+
|
38
|
+
exists wget;
|
39
|
+
if test $? -eq 0; then
|
40
|
+
do_wget "$1" "$2" && return 0;
|
41
|
+
fi
|
42
|
+
|
43
|
+
exists curl;
|
44
|
+
if test $? -eq 0; then
|
45
|
+
do_curl "$1" "$2" && return 0;
|
46
|
+
fi
|
47
|
+
|
48
|
+
exists fetch;
|
49
|
+
if test $? -eq 0; then
|
50
|
+
do_fetch "$1" "$2" && return 0;
|
51
|
+
fi
|
52
|
+
|
53
|
+
exists python;
|
54
|
+
if test $? -eq 0; then
|
55
|
+
do_python "$1" "$2" && return 0;
|
56
|
+
fi
|
57
|
+
|
58
|
+
exists perl;
|
59
|
+
if test $? -eq 0; then
|
60
|
+
do_perl "$1" "$2" && return 0;
|
61
|
+
fi
|
62
|
+
|
63
|
+
unable_to_download "$1" "$2";
|
64
|
+
}
|
65
|
+
|
66
|
+
# do_fetch URL FILENAME
|
67
|
+
do_fetch() {
|
68
|
+
echo "Trying fetch...";
|
69
|
+
fetch -o "$2" "$1" 2>"$tmp_stderr";
|
70
|
+
ec=$?;
|
71
|
+
# check for 404
|
72
|
+
grep "Not Found" "$tmp_stderr" 2>&1 >/dev/null;
|
73
|
+
if test $? -eq 0; then
|
74
|
+
http_404_error "$1";
|
75
|
+
fi
|
76
|
+
|
77
|
+
# check for bad return status or empty output
|
78
|
+
if test $ec -ne 0 || test ! -s "$2"; then
|
79
|
+
capture_tmp_stderr "fetch";
|
80
|
+
return 1;
|
81
|
+
else
|
82
|
+
echo "Download complete.";
|
83
|
+
return 0;
|
84
|
+
fi
|
85
|
+
}
|
86
|
+
|
87
|
+
# do_perl URL FILENAME
|
88
|
+
do_perl() {
|
89
|
+
echo "Trying perl...";
|
90
|
+
perl -e "use LWP::Simple; getprint(\$ARGV[0]);" "$1" > "$2" 2>"$tmp_stderr";
|
91
|
+
ec=$?;
|
92
|
+
# check for 404
|
93
|
+
grep "404 Not Found" "$tmp_stderr" 2>&1 >/dev/null;
|
94
|
+
if test $? -eq 0; then
|
95
|
+
http_404_error "$1";
|
96
|
+
fi
|
97
|
+
|
98
|
+
# check for bad return status or empty output
|
99
|
+
if test $ec -ne 0 || test ! -s "$2"; then
|
100
|
+
capture_tmp_stderr "perl";
|
101
|
+
return 1;
|
102
|
+
else
|
103
|
+
echo "Download complete.";
|
104
|
+
return 0;
|
105
|
+
fi
|
106
|
+
}
|
107
|
+
|
108
|
+
# do_python URL FILENAME
|
109
|
+
do_python() {
|
110
|
+
echo "Trying python...";
|
111
|
+
python -c "import sys,urllib2 ; sys.stdout.write(urllib2.urlopen(sys.argv[1]).read())" "$1" > "$2" 2>"$tmp_stderr";
|
112
|
+
ec=$?;
|
113
|
+
# check for 404
|
114
|
+
grep "HTTP Error 404" "$tmp_stderr" 2>&1 >/dev/null;
|
115
|
+
if test $? -eq 0; then
|
116
|
+
http_404_error "$1";
|
117
|
+
fi
|
118
|
+
|
119
|
+
# check for bad return status or empty output
|
120
|
+
if test $ec -ne 0 || test ! -s "$2"; then
|
121
|
+
capture_tmp_stderr "python";
|
122
|
+
return 1;
|
123
|
+
else
|
124
|
+
echo "Download complete.";
|
125
|
+
return 0;
|
126
|
+
fi
|
127
|
+
}
|
128
|
+
|
129
|
+
# do_wget URL FILENAME
|
130
|
+
do_wget() {
|
131
|
+
echo "Trying wget...";
|
132
|
+
wget -O "$2" "$1" 2>"$tmp_stderr";
|
133
|
+
ec=$?;
|
134
|
+
# check for 404
|
135
|
+
grep "ERROR 404" "$tmp_stderr" 2>&1 >/dev/null;
|
136
|
+
if test $? -eq 0; then
|
137
|
+
http_404_error "$1";
|
138
|
+
fi
|
139
|
+
|
140
|
+
# check for bad return status or empty output
|
141
|
+
if test $ec -ne 0 || test ! -s "$2"; then
|
142
|
+
capture_tmp_stderr "wget";
|
143
|
+
return 1;
|
144
|
+
else
|
145
|
+
echo "Download complete.";
|
146
|
+
return 0;
|
147
|
+
fi
|
148
|
+
}
|
149
|
+
|
150
|
+
# exists COMMAND
|
151
|
+
exists() {
|
152
|
+
if command -v "$1" >/dev/null 2>&1; then
|
153
|
+
return 0;
|
154
|
+
else
|
155
|
+
return 1;
|
156
|
+
fi
|
157
|
+
}
|
158
|
+
|
159
|
+
# http_404_error URL
|
160
|
+
http_404_error() {
|
161
|
+
echo ">>>>>> Downloading ${1} resulted in an HTTP/404, aborting";
|
162
|
+
exit 40;
|
163
|
+
}
|
164
|
+
|
165
|
+
# should_update_chef ROOT VERSION
|
166
|
+
should_update_chef() {
|
167
|
+
if test ! -d "$1"; then
|
168
|
+
return 0;
|
169
|
+
elif test "$2" = "true"; then
|
170
|
+
return 1;
|
171
|
+
elif test "$2" = "latest"; then
|
172
|
+
return 0;
|
173
|
+
fi
|
174
|
+
|
175
|
+
if test -f "${1}/version-manifest.txt"; then
|
176
|
+
chef_version="`head -n 1 ${1}/version-manifest.txt | cut -d \" \" -f 2`";
|
177
|
+
else
|
178
|
+
chef_version="`${1}/bin/chef-solo -v | cut -d \" \" -f 2`";
|
179
|
+
fi
|
180
|
+
|
181
|
+
echo "$chef_version" | grep "^${2}" 2>&1 >/dev/null;
|
182
|
+
if test $? -eq 0; then
|
183
|
+
return 1;
|
184
|
+
else
|
185
|
+
echo "${2}" | grep "^$chef_version" 2>&1 >/dev/null;
|
186
|
+
if test $? -eq 0; then
|
187
|
+
return 1;
|
188
|
+
else
|
189
|
+
return 0;
|
190
|
+
fi
|
191
|
+
fi
|
192
|
+
}
|
193
|
+
|
194
|
+
# unable_to_download URL FILE
|
195
|
+
unable_to_download() {
|
196
|
+
echo "Unable to download $1 to $2, aborting";
|
197
|
+
|
198
|
+
if test "x${stderr_results}" != "x"; then
|
199
|
+
echo "\nDEBUG OUTPUT FOLLOWS:\n${stderr_results}";
|
200
|
+
fi
|
201
|
+
|
202
|
+
exit 10;
|
203
|
+
}
|
204
|
+
|
205
|
+
# main
|
206
|
+
main() {
|
207
|
+
should_update_chef "$chef_omnibus_root" "$version"
|
208
|
+
if test $? -eq 0; then
|
209
|
+
echo "-----> Installing Chef Omnibus (${pretty_version})";
|
210
|
+
|
211
|
+
# solaris 10 lacks recent enough credentials, so http url is used
|
212
|
+
platform="`/usr/bin/uname -s 2>/dev/null`";
|
213
|
+
platform_version="`/usr/bin/uname -r 2>/dev/null`";
|
214
|
+
if test "x${platform}" = "xSunOS" && test "x${platform_version}" = "x5.10"; then
|
215
|
+
chef_omnibus_url=`echo "$chef_omnibus_url" | sed -e "s/https/http/"`;
|
216
|
+
fi
|
217
|
+
|
218
|
+
do_download "$chef_omnibus_url" /tmp/install.sh;
|
219
|
+
$sudo_sh /tmp/install.sh $install_flags;
|
220
|
+
else
|
221
|
+
echo "-----> Chef Omnibus installation detected (${pretty_version})";
|
222
|
+
fi
|
223
|
+
}
|
224
|
+
|
225
|
+
# augment path in an attempt to find a download program
|
226
|
+
PATH="${PATH}:/opt/local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/sfw/bin";
|
227
|
+
export PATH;
|
228
|
+
|
229
|
+
main
|
metadata
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wjordan-mixlib-install
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.0.alpha.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Will Jordan
|
8
|
+
- Thom May
|
9
|
+
- Patrick Wright
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: artifactory
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.3.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 2.3.0
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: mixlib-versioning
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 1.1.0
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.1.0
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: bundler
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: rake
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '10.0'
|
64
|
+
type: :development
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '10.0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rspec
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '3.3'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '3.3'
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: pry
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
description:
|
100
|
+
email:
|
101
|
+
- will@code.org
|
102
|
+
- thom@chef.io
|
103
|
+
- patrick@chef.io
|
104
|
+
executables: []
|
105
|
+
extensions: []
|
106
|
+
extra_rdoc_files: []
|
107
|
+
files:
|
108
|
+
- ".gitignore"
|
109
|
+
- ".rspec"
|
110
|
+
- ".rubocop.yml"
|
111
|
+
- ".travis.yml"
|
112
|
+
- CONTRIBUTING.md
|
113
|
+
- Gemfile
|
114
|
+
- LICENSE
|
115
|
+
- PRODUCT_MATRIX.md
|
116
|
+
- README.md
|
117
|
+
- Rakefile
|
118
|
+
- acceptance/.gitignore
|
119
|
+
- acceptance/Gemfile
|
120
|
+
- acceptance/current/.acceptance/acceptance-cookbook/.gitignore
|
121
|
+
- acceptance/current/.acceptance/acceptance-cookbook/metadata.rb
|
122
|
+
- acceptance/current/.acceptance/acceptance-cookbook/recipes/destroy.rb
|
123
|
+
- acceptance/current/.acceptance/acceptance-cookbook/recipes/provision.rb
|
124
|
+
- acceptance/current/.acceptance/acceptance-cookbook/recipes/verify.rb
|
125
|
+
- acceptance/current/.kitchen.yml
|
126
|
+
- acceptance/unstable/.acceptance/acceptance-cookbook/.gitignore
|
127
|
+
- acceptance/unstable/.acceptance/acceptance-cookbook/metadata.rb
|
128
|
+
- acceptance/unstable/.acceptance/acceptance-cookbook/recipes/destroy.rb
|
129
|
+
- acceptance/unstable/.acceptance/acceptance-cookbook/recipes/provision.rb
|
130
|
+
- acceptance/unstable/.acceptance/acceptance-cookbook/recipes/verify.rb
|
131
|
+
- acceptance/unstable/.kitchen.yml
|
132
|
+
- lib/mixlib/install.rb
|
133
|
+
- lib/mixlib/install/artifact_info.rb
|
134
|
+
- lib/mixlib/install/backend.rb
|
135
|
+
- lib/mixlib/install/backend/artifactory.rb
|
136
|
+
- lib/mixlib/install/backend/omnitruck.rb
|
137
|
+
- lib/mixlib/install/generator.rb
|
138
|
+
- lib/mixlib/install/generator/base.rb
|
139
|
+
- lib/mixlib/install/generator/bourne.rb
|
140
|
+
- lib/mixlib/install/generator/bourne/scripts/artifactory_urls.sh.erb
|
141
|
+
- lib/mixlib/install/generator/bourne/scripts/fetch_metadata.sh.erb
|
142
|
+
- lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
|
143
|
+
- lib/mixlib/install/generator/bourne/scripts/helpers.sh
|
144
|
+
- lib/mixlib/install/generator/bourne/scripts/install_package.sh
|
145
|
+
- lib/mixlib/install/generator/bourne/scripts/platform_detection.sh
|
146
|
+
- lib/mixlib/install/generator/bourne/scripts/script_cli_parameters.sh
|
147
|
+
- lib/mixlib/install/generator/powershell.rb
|
148
|
+
- lib/mixlib/install/generator/powershell/scripts/get_project_metadata.ps1.erb
|
149
|
+
- lib/mixlib/install/generator/powershell/scripts/get_project_metadata_for_artifactory.ps1.erb
|
150
|
+
- lib/mixlib/install/generator/powershell/scripts/helpers.ps1
|
151
|
+
- lib/mixlib/install/generator/powershell/scripts/install_project.ps1
|
152
|
+
- lib/mixlib/install/options.rb
|
153
|
+
- lib/mixlib/install/product.rb
|
154
|
+
- lib/mixlib/install/script_generator.rb
|
155
|
+
- lib/mixlib/install/util.rb
|
156
|
+
- lib/mixlib/install/version.rb
|
157
|
+
- mixlib-install.gemspec
|
158
|
+
- support/install_command.ps1
|
159
|
+
- support/install_command.sh
|
160
|
+
homepage: https://chef.io
|
161
|
+
licenses:
|
162
|
+
- Apache-2.0
|
163
|
+
metadata: {}
|
164
|
+
post_install_message:
|
165
|
+
rdoc_options: []
|
166
|
+
require_paths:
|
167
|
+
- lib
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - ">"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: 1.3.1
|
178
|
+
requirements: []
|
179
|
+
rubyforge_project:
|
180
|
+
rubygems_version: 2.4.8
|
181
|
+
signing_key:
|
182
|
+
specification_version: 4
|
183
|
+
summary: A mixin to help with omnitruck installs (edge fork)
|
184
|
+
test_files: []
|
185
|
+
has_rdoc:
|