mixlib-install 0.8.0.alpha.0 → 0.8.0.alpha.1

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
  SHA1:
3
- metadata.gz: 1988cb752e5752ed1b0c356f95c821e1d3376570
4
- data.tar.gz: 4a85a7442cc38bc55df9136f736eea91d6bd7bcd
3
+ metadata.gz: 4fabcb72fdaa90f9d22728c896b821671af560e3
4
+ data.tar.gz: 6f21894be53ccb12f66ff61c9df76c772c479683
5
5
  SHA512:
6
- metadata.gz: 5464fd31ead9f86d3665c156cafe93b72ca7413fa7f34911aaee22bfcbf9ed9ed2858ae78064387a7f49db5d0b5e04e4498107a1a1d8012ee2f77f10b5655472
7
- data.tar.gz: b3867d25ee74bb1d72e418a135dfe7b881601fec995319ca139f7e9721da37d749340570055dc1901de55b9682bb5e22de10404861346af4202d9a3bacb1d8df
6
+ metadata.gz: 97ace41631a3b9707d825e9b046f561f00a55c625f77f91775aa2db82e91c7f535c265254ef8f528a8fbcc09a77f3f1f59e986170fc40bf99e9e3fbe9d894cc7
7
+ data.tar.gz: f3effede4eebd11083b94dc884eb0e7995e75fb6f06a1517cefc9416fe6f2036cd3340dc9e8c30c0ce5cd8c32cdd700169d0152186288358d089c75536308b34
@@ -0,0 +1,20 @@
1
+ | Product | Product Key |
2
+ | ------- | ------------ |
3
+ | Analytics Platform | analytics |
4
+ | Chef Client | chef |
5
+ | Chef Server High Availability addon | chef-ha |
6
+ | Chef Cloud Marketplace addon | chef-marketplace |
7
+ | Chef Server | chef-server |
8
+ | Chef Server Replication addon | chef-sync |
9
+ | Chef Development Kit | chefdk |
10
+ | Chef Compliance | compliance |
11
+ | Delivery | delivery |
12
+ | Delivery CLI | delivery-cli |
13
+ | Management Console | manage |
14
+ | Enterprise Chef (legacy) | private-chef |
15
+ | Chef Push Server | push-client |
16
+ | Chef Push Server | push-server |
17
+ | Chef Server Reporting addon | reporting |
18
+ | Supermarket | supermarket |
19
+
20
+ Do not modify this file manually. It is automatically rendered via a rake task.
data/Rakefile CHANGED
@@ -17,3 +17,22 @@ end
17
17
 
18
18
  desc "Run all tests"
19
19
  task test: [:rubocop, :spec]
20
+
21
+ desc "Render product matrix documentation"
22
+ task "matrix" do
23
+ require "mixlib/install/product"
24
+
25
+ doc_file = File.join(File.dirname(__FILE__), "PRODUCT_MATRIX.md")
26
+ puts "Updating doc file at: #{doc_file}"
27
+
28
+ File.open(doc_file, "w+") do |f|
29
+ f.puts("| Product | Product Key |")
30
+ f.puts("| ------- | ------------ |")
31
+ PRODUCT_MATRIX.products.sort.each do |p_key|
32
+ product = PRODUCT_MATRIX.lookup(p_key)
33
+ f.puts("| #{product.product_name} | #{p_key} |")
34
+ end
35
+ f.puts("")
36
+ f.puts("Do not modify this file manually. It is automatically rendered via a rake task.")
37
+ end
38
+ end
@@ -1,6 +1,6 @@
1
1
  GIT
2
2
  remote: git://github.com/chef/chef-acceptance.git
3
- revision: 2d1a192851a3731cb61f794d155ad2b156cdaec5
3
+ revision: e28d67891b0359af83836ec55c91eb07e8b062d1
4
4
  specs:
5
5
  chef-acceptance (0.2.0)
6
6
  thor (~> 0.19)
@@ -20,18 +20,20 @@ GIT
20
20
  PATH
21
21
  remote: ../
22
22
  specs:
23
- mixlib-install (0.8.0)
23
+ mixlib-install (0.8.0.alpha.0)
24
24
  artifactory (~> 2.3.0)
25
+ mixlib-versioning (~> 1.1.0)
25
26
 
26
27
  GEM
27
28
  remote: https://rubygems.org/
28
29
  specs:
29
- artifactory (2.3.1)
30
+ artifactory (2.3.2)
30
31
  coderay (1.1.0)
31
32
  kitchen-vagrant (0.19.0)
32
33
  test-kitchen (~> 1.4)
33
34
  method_source (0.8.2)
34
35
  mixlib-shellout (2.2.3)
36
+ mixlib-versioning (1.1.0)
35
37
  net-scp (1.2.1)
36
38
  net-ssh (>= 2.6.5)
37
39
  net-ssh (2.9.2)
@@ -1,3 +1,3 @@
1
1
  execute 'kitchen destroy' do
2
- cwd File.join(File.dirname(__FILE__), "../../../../../../../..")
2
+ cwd node['chef-acceptance']['suite-dir']
3
3
  end
@@ -1,3 +1,3 @@
1
1
  execute 'kitchen verify' do
2
- cwd File.join(File.dirname(__FILE__), "../../../../../../../..")
2
+ cwd node['chef-acceptance']['suite-dir']
3
3
  end
@@ -0,0 +1,264 @@
1
+ #
2
+ # Copyright:: Copyright (c) 2015 Chef, Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require "mixlib/versioning"
19
+
20
+ module Mixlib
21
+ class Install
22
+ class Product
23
+ def initialize(&block)
24
+ instance_eval(&block)
25
+ end
26
+
27
+ DSL_PROPERTIES = [
28
+ :config_file,
29
+ :ctl_command,
30
+ :package_name,
31
+ :product_name
32
+ ]
33
+
34
+ #
35
+ # DSL methods can receive either a String or a Proc to calculate the
36
+ # value of the property later on based on the version.
37
+ # We error out if we get both the String and Proc, and we return the value
38
+ # of the property if we do not receive anything.
39
+ #
40
+ # @param [String] prop_string
41
+ # value to be set in String form
42
+ # @param [Proc] block
43
+ # value to be set in Proc form
44
+ #
45
+ # @return [String] value of the property
46
+ #
47
+ DSL_PROPERTIES.each do |prop|
48
+ define_method prop do |prop_string = nil, &block|
49
+ if block.nil?
50
+ if prop_string.nil?
51
+ value = instance_variable_get("@#{prop}".to_sym)
52
+ return nil if value.nil?
53
+
54
+ if value.is_a? String
55
+ value
56
+ else
57
+ value.call(version_for(version))
58
+ end
59
+ else
60
+ instance_variable_set("@#{prop}".to_sym, prop_string)
61
+ end
62
+ else
63
+ raise "Can not use String and Proc at the same time for #{prop}." if !prop_string.nil?
64
+ instance_variable_set("@#{prop}".to_sym, block)
65
+ end
66
+ end
67
+ end
68
+
69
+ #
70
+ # Sets or retrieves the version for the product. This is used later
71
+ # when we are reading the value of a property if a Proc is specified
72
+ #
73
+ def version(value = nil)
74
+ if value.nil?
75
+ @version
76
+ else
77
+ @version = value
78
+ end
79
+ end
80
+
81
+ #
82
+ # Helper method to convert versions from String to Mixlib::Version
83
+ #
84
+ # @param [String] version_string
85
+ # value to be set in String form
86
+ #
87
+ # @return [Mixlib::Version]
88
+ def version_for(version_string)
89
+ Mixlib::Versioning.parse(version_string)
90
+ end
91
+ end
92
+
93
+ class ProductMatrix
94
+ def initialize(&block)
95
+ @product_map = {}
96
+ instance_eval(&block)
97
+ end
98
+
99
+ #
100
+ # The only DSL method of this class. It creates a Product with given
101
+ # `key` and stores it.
102
+ #
103
+ def product(key, &block)
104
+ @product_map[key] = Product.new(&block)
105
+ end
106
+
107
+ #
108
+ # Fetches the keys of available products.
109
+ #
110
+ # @return Array[String] of keys
111
+ def products
112
+ @product_map.keys
113
+ end
114
+
115
+ #
116
+ # Looks up a product and sets version on it to be used later by the
117
+ # Product.
118
+ #
119
+ # @param [String] key
120
+ # Lookup key of the product.
121
+ # @param [String] version
122
+ # Version to be set for the product. By default version is set to :latest
123
+ #
124
+ # @return [Product]
125
+ def lookup(key, version = :latest)
126
+ product = @product_map[key]
127
+ # We set the lookup version for the product to a very high number in
128
+ # order to mimic :latest so that one does not need to handle this
129
+ # symbol explicitly when constructing logic based on version numbers.
130
+ version = "1000.1000.1000" if version.to_sym == :latest
131
+ product.version(version)
132
+ product
133
+ end
134
+ end
135
+ end
136
+ end
137
+
138
+ #
139
+ # If you are making a change to PRODUCT_MATRIX, please make sure
140
+ # you run `bundle exec rake matrix` at the home of this repository
141
+ # to update PRODUCT_MATRIX.md.
142
+ #
143
+ PRODUCT_MATRIX = Mixlib::Install::ProductMatrix.new do
144
+ # Products in alphabetical order
145
+
146
+ product "analytics" do
147
+ product_name "Analytics Platform"
148
+ package_name "opscode-analytics"
149
+ ctl_command "opscode-analytics-ctl"
150
+ config_file "/etc/opscode-analytics/opscode-analytics.rb"
151
+ end
152
+
153
+ product "chef" do
154
+ product_name "Chef Client"
155
+ package_name "chef"
156
+ end
157
+
158
+ product "chef-ha" do
159
+ product_name "Chef Server High Availability addon"
160
+ package_name "chef-ha"
161
+ config_file "/etc/opscode/chef-server.rb"
162
+ end
163
+
164
+ product "chef-marketplace" do
165
+ product_name "Chef Cloud Marketplace addon"
166
+ package_name "chef-marketplace"
167
+ ctl_command "chef-marketplace-ctl"
168
+ config_file "/etc/chef-marketplace/marketplace.rb"
169
+ end
170
+
171
+ product "chef-server" do
172
+ product_name "Chef Server"
173
+ package_name do |v|
174
+ if (v < version_for("12.0.0")) && (v > version_for("11.0.0"))
175
+ "chef-server"
176
+ else
177
+ "chef-server-core"
178
+ end
179
+ end
180
+ ctl_command "chef-server-ctl"
181
+ config_file "/etc/opscode/chef-server.rb"
182
+ end
183
+
184
+ product "chef-sync" do
185
+ product_name "Chef Server Replication addon"
186
+ package_name "chef-sync"
187
+ ctl_command "chef-sync-ctl"
188
+ config_file "/etc/chef-sync/chef-sync.rb"
189
+ end
190
+
191
+ product "chefdk" do
192
+ product_name "Chef Development Kit"
193
+ package_name "chefdk"
194
+ end
195
+
196
+ product "compliance" do
197
+ product_name "Chef Compliance"
198
+ package_name "chef-compliance"
199
+ ctl_command "chef-compliance-ctl"
200
+ config_file "/etc/chef-compliance/chef-compliance.rb"
201
+ end
202
+
203
+ product "delivery" do
204
+ product_name "Delivery"
205
+ package_name "delivery"
206
+ ctl_command "delivery-ctl"
207
+ config_file "/etc/delivery/delivery.rb"
208
+ end
209
+
210
+ product "delivery-cli" do
211
+ product_name "Delivery CLI"
212
+ package_name "delivery-cli"
213
+ end
214
+
215
+ product "manage" do
216
+ product_name "Management Console"
217
+ package_name do |v|
218
+ v < version_for("2.0.0") ? "opscode-manage" : "chef-manage"
219
+ end
220
+ ctl_command do |v|
221
+ v < version_for("2.0.0") ? "opscode-manage-ctl" : "chef-manage-ctl"
222
+ end
223
+ config_file "/etc/opscode-manage/manage.rb"
224
+ end
225
+
226
+ product "private-chef" do
227
+ product_name "Enterprise Chef (legacy)"
228
+ package_name "private-chef"
229
+ ctl_command "private-chef-ctl"
230
+ config_file "/etc/opscode/private-chef.rb"
231
+ end
232
+
233
+ product "push-client" do
234
+ product_name "Chef Push Server"
235
+ package_name do |v|
236
+ v < version_for("1.3.0") ? "opscode-push-jobs-client" : "push-jobs-client"
237
+ end
238
+ end
239
+
240
+ product "push-server" do
241
+ product_name "Chef Push Server"
242
+ package_name do |v|
243
+ v < version_for("2.0.0") ? "opscode-push-jobs-server" : "push-jobs-server"
244
+ end
245
+ ctl_command do |v|
246
+ v < version_for("2.0.0") ? "opscode-push-jobs-server-ctl" : "push-jobs-server-ctl"
247
+ end
248
+ config_file "/etc/opscode-push-jobs-server/opscode-push-jobs-server.rb"
249
+ end
250
+
251
+ product "reporting" do
252
+ product_name "Chef Server Reporting addon"
253
+ package_name "opscode-reporting"
254
+ ctl_command "opscode-reporting-ctl"
255
+ config_file "/etc/opscode-reporting/opscode-reporting.rb"
256
+ end
257
+
258
+ product "supermarket" do
259
+ product_name "Supermarket"
260
+ package_name "supermarket"
261
+ ctl_command "supermarket-ctl"
262
+ config_file "/etc/supermarket/supermarket.json"
263
+ end
264
+ end
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "0.8.0.alpha.0"
3
+ VERSION = "0.8.0.alpha.1"
4
4
  end
5
5
  end
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.8.0.alpha.0
4
+ version: 0.8.0.alpha.1
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: 2015-12-01 00:00:00.000000000 Z
12
+ date: 2015-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: artifactory
@@ -110,12 +110,12 @@ files:
110
110
  - CONTRIBUTING.md
111
111
  - Gemfile
112
112
  - LICENSE
113
+ - PRODUCT_MATRIX.md
113
114
  - README.md
114
115
  - Rakefile
115
- - acceptance/.gitignore
116
116
  - acceptance/Gemfile
117
117
  - acceptance/Gemfile.lock
118
- - acceptance/current/.acceptance/acceptance-cookbook/.chef/config.rb
118
+ - acceptance/current/.acceptance/acceptance-cookbook/.gitignore
119
119
  - acceptance/current/.acceptance/acceptance-cookbook/metadata.rb
120
120
  - acceptance/current/.acceptance/acceptance-cookbook/recipes/destroy.rb
121
121
  - acceptance/current/.acceptance/acceptance-cookbook/recipes/provision.rb
@@ -134,6 +134,7 @@ files:
134
134
  - lib/mixlib/install/generator/bourne/scripts/install_package.sh
135
135
  - lib/mixlib/install/generator/bourne/scripts/platform_detection.sh
136
136
  - lib/mixlib/install/options.rb
137
+ - lib/mixlib/install/product.rb
137
138
  - lib/mixlib/install/script_generator.rb
138
139
  - lib/mixlib/install/util.rb
139
140
  - lib/mixlib/install/version.rb
@@ -1,2 +0,0 @@
1
- local-mode-cache/
2
- nodes/
@@ -1 +0,0 @@
1
- cookbook_path File.join(File.dirname(__FILE__), '..', '..')