mixlib-install 0.8.0.alpha.8 → 1.0.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/README.md +14 -0
- data/lib/mixlib/install.rb +16 -8
- data/lib/mixlib/install/backend.rb +1 -1
- data/lib/mixlib/install/backend/bintray.rb +1 -1
- data/lib/mixlib/install/script_generator.rb +2 -2
- data/lib/mixlib/install/version.rb +1 -1
- data/mixlib-install.gemspec +3 -2
- metadata +23 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c49c14b6182e48d0e62bdddc9677cc8c368eb30
|
4
|
+
data.tar.gz: 36429f8f5161f5ed5ea3a75aaeafc6ebdf43c3d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5560590bf8b7e98ac892073bb8f89ff18d31b0ad285c153d8257c5295d1926e6525e6bc40554886e8a5340c6e02a88be76b5323ecc4d963dce7021818a29bd28
|
7
|
+
data.tar.gz: 93358f525f3b45e3ef426b0312e61f2151886a6d6c80fff2ee8a37524769ed118ba68fd59b536c861be302154f4e6b4f8ddf1be023681406421b7ff1631d6a83
|
data/README.md
CHANGED
@@ -35,6 +35,20 @@ artifacts.first.url
|
|
35
35
|
# => "http://opscode-omnibus-packages-current.s3.amazonaws.com/mac_os_x/10.9/x86_64/chef-12.5.1%2B20151009083009-1.dmg"
|
36
36
|
```
|
37
37
|
|
38
|
+
### Detect platform information
|
39
|
+
```ruby
|
40
|
+
options = {
|
41
|
+
channel: :current,
|
42
|
+
product_name: 'chef',
|
43
|
+
product_version: :latest
|
44
|
+
}
|
45
|
+
|
46
|
+
artifact = Mixlib::Install.new(options).detect_platform
|
47
|
+
|
48
|
+
artifact.platform # => "mac_os_x"
|
49
|
+
artifact.platform_version # => "10.10"
|
50
|
+
```
|
51
|
+
|
38
52
|
## Unstable channel
|
39
53
|
The `:unstable` channel is currently only available when connected to Chef's internal network.
|
40
54
|
Configure Artifactory access by setting the following environment variables:
|
data/lib/mixlib/install.rb
CHANGED
@@ -18,6 +18,7 @@
|
|
18
18
|
#
|
19
19
|
|
20
20
|
require "mixlib/versioning"
|
21
|
+
require "mixlib/shellout"
|
21
22
|
|
22
23
|
require "mixlib/install/backend"
|
23
24
|
require "mixlib/install/options"
|
@@ -37,8 +38,10 @@ module Mixlib
|
|
37
38
|
#
|
38
39
|
# Fetch artifact metadata information
|
39
40
|
#
|
40
|
-
# @return [ArtifactInfo] fetched artifact data
|
41
|
-
#
|
41
|
+
# @return [Array<ArtifactInfo>] list of fetched artifact data for the configured
|
42
|
+
# channel, product name, and product version.
|
43
|
+
# @return [ArtifactInfo] fetched artifact data for the configured
|
44
|
+
# channel, product name, product version and platform info
|
42
45
|
def artifact_info
|
43
46
|
Backend.info(options)
|
44
47
|
end
|
@@ -94,7 +97,9 @@ module Mixlib
|
|
94
97
|
def upgrade_available?
|
95
98
|
return true if current_version.nil?
|
96
99
|
|
97
|
-
|
100
|
+
artifact = artifact_info
|
101
|
+
artifact = artifact.first if artifact.is_a? Array
|
102
|
+
available_ver = Mixlib::Versioning.parse(artifact.version)
|
98
103
|
current_ver = Mixlib::Versioning.parse(current_version)
|
99
104
|
(available_ver > current_ver)
|
100
105
|
end
|
@@ -111,11 +116,14 @@ module Mixlib
|
|
111
116
|
# Returns a Hash containing the platform info options
|
112
117
|
#
|
113
118
|
def self.detect_platform
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
+
detect_command = if Gem.win_platform?
|
120
|
+
Mixlib::ShellOut.new(self.detect_platform_ps1)
|
121
|
+
else
|
122
|
+
Mixlib::ShellOut.new(self.detect_platform_sh)
|
123
|
+
end
|
124
|
+
|
125
|
+
detect_command.run_command
|
126
|
+
platform_info = detect_command.stdout.split
|
119
127
|
|
120
128
|
{
|
121
129
|
platform: platform_info[0],
|
@@ -113,7 +113,7 @@ module Mixlib
|
|
113
113
|
# @return [Array<ArtifactInfo>] Array of info about found artifacts
|
114
114
|
#
|
115
115
|
def bintray_artifacts
|
116
|
-
version = options.
|
116
|
+
version = options.latest_version? ? latest_version : options.product_version
|
117
117
|
results = bintray_get("#{options.channel}/#{options.product_name}/versions/#{version}/files")
|
118
118
|
|
119
119
|
#
|
@@ -69,7 +69,7 @@ module Mixlib
|
|
69
69
|
sudo_command}
|
70
70
|
|
71
71
|
def initialize(version, powershell = false, opts = {})
|
72
|
-
@version = version || "latest"
|
72
|
+
@version = (version || "latest").to_s.downcase
|
73
73
|
@powershell = powershell
|
74
74
|
@http_proxy = nil
|
75
75
|
@https_proxy = nil
|
@@ -198,7 +198,7 @@ module Mixlib
|
|
198
198
|
|
199
199
|
url = "#{base}#{endpoint}"
|
200
200
|
url << "?p=windows&m=x86_64&pv=2008r2" # same package for all versions
|
201
|
-
url << "&v=#{CGI.escape(version
|
201
|
+
url << "&v=#{CGI.escape(version)}" unless %w{latest true nightlies}.include?(version)
|
202
202
|
url << "&prerelease=true" if prerelease
|
203
203
|
url << "&nightlies=true" if nightlies
|
204
204
|
url
|
data/mixlib-install.gemspec
CHANGED
@@ -17,8 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "artifactory", "
|
21
|
-
spec.add_dependency "mixlib-versioning", "
|
20
|
+
spec.add_dependency "artifactory", ">= 2.3.0"
|
21
|
+
spec.add_dependency "mixlib-versioning", ">= 1.1.0"
|
22
|
+
spec.add_dependency "mixlib-shellout", ">= 2.2.6"
|
22
23
|
|
23
24
|
spec.add_development_dependency "bundler"
|
24
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
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: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom May
|
@@ -9,36 +9,50 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
12
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: artifactory
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 2.3.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 2.3.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: mixlib-versioning
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 1.1.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 1.1.0
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: mixlib-shellout
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 2.2.6
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 2.2.6
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: bundler
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,9 +202,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
202
|
version: '0'
|
189
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
204
|
requirements:
|
191
|
-
- - "
|
205
|
+
- - ">="
|
192
206
|
- !ruby/object:Gem::Version
|
193
|
-
version:
|
207
|
+
version: '0'
|
194
208
|
requirements: []
|
195
209
|
rubyforge_project:
|
196
210
|
rubygems_version: 2.5.2
|
@@ -198,3 +212,4 @@ signing_key:
|
|
198
212
|
specification_version: 4
|
199
213
|
summary: A mixin to help with omnitruck installs
|
200
214
|
test_files: []
|
215
|
+
has_rdoc:
|