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.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +10 -0
  5. data/.travis.yml +8 -0
  6. data/CONTRIBUTING.md +14 -0
  7. data/Gemfile +5 -0
  8. data/LICENSE +201 -0
  9. data/PRODUCT_MATRIX.md +24 -0
  10. data/README.md +55 -0
  11. data/Rakefile +53 -0
  12. data/acceptance/.gitignore +2 -0
  13. data/acceptance/Gemfile +12 -0
  14. data/acceptance/current/.acceptance/acceptance-cookbook/.gitignore +2 -0
  15. data/acceptance/current/.acceptance/acceptance-cookbook/metadata.rb +1 -0
  16. data/acceptance/current/.acceptance/acceptance-cookbook/recipes/destroy.rb +3 -0
  17. data/acceptance/current/.acceptance/acceptance-cookbook/recipes/provision.rb +3 -0
  18. data/acceptance/current/.acceptance/acceptance-cookbook/recipes/verify.rb +3 -0
  19. data/acceptance/current/.kitchen.yml +41 -0
  20. data/acceptance/unstable/.acceptance/acceptance-cookbook/.gitignore +2 -0
  21. data/acceptance/unstable/.acceptance/acceptance-cookbook/metadata.rb +1 -0
  22. data/acceptance/unstable/.acceptance/acceptance-cookbook/recipes/destroy.rb +3 -0
  23. data/acceptance/unstable/.acceptance/acceptance-cookbook/recipes/provision.rb +3 -0
  24. data/acceptance/unstable/.acceptance/acceptance-cookbook/recipes/verify.rb +3 -0
  25. data/acceptance/unstable/.kitchen.yml +41 -0
  26. data/lib/mixlib/install/artifact_info.rb +76 -0
  27. data/lib/mixlib/install/backend/artifactory.rb +214 -0
  28. data/lib/mixlib/install/backend/omnitruck.rb +76 -0
  29. data/lib/mixlib/install/backend.rb +36 -0
  30. data/lib/mixlib/install/generator/base.rb +65 -0
  31. data/lib/mixlib/install/generator/bourne/scripts/artifactory_urls.sh.erb +31 -0
  32. data/lib/mixlib/install/generator/bourne/scripts/fetch_metadata.sh.erb +48 -0
  33. data/lib/mixlib/install/generator/bourne/scripts/fetch_package.sh +53 -0
  34. data/lib/mixlib/install/generator/bourne/scripts/helpers.sh +340 -0
  35. data/lib/mixlib/install/generator/bourne/scripts/install_package.sh +33 -0
  36. data/lib/mixlib/install/generator/bourne/scripts/platform_detection.sh +165 -0
  37. data/lib/mixlib/install/generator/bourne/scripts/script_cli_parameters.sh +36 -0
  38. data/lib/mixlib/install/generator/bourne.rb +71 -0
  39. data/lib/mixlib/install/generator/powershell/scripts/get_project_metadata.ps1.erb +96 -0
  40. data/lib/mixlib/install/generator/powershell/scripts/get_project_metadata_for_artifactory.ps1.erb +92 -0
  41. data/lib/mixlib/install/generator/powershell/scripts/helpers.ps1 +69 -0
  42. data/lib/mixlib/install/generator/powershell/scripts/install_project.ps1 +99 -0
  43. data/lib/mixlib/install/generator/powershell.rb +94 -0
  44. data/lib/mixlib/install/generator.rb +33 -0
  45. data/lib/mixlib/install/options.rb +152 -0
  46. data/lib/mixlib/install/product.rb +288 -0
  47. data/lib/mixlib/install/script_generator.rb +217 -0
  48. data/lib/mixlib/install/util.rb +124 -0
  49. data/lib/mixlib/install/version.rb +5 -0
  50. data/lib/mixlib/install.rb +124 -0
  51. data/mixlib-install.gemspec +27 -0
  52. data/support/install_command.ps1 +84 -0
  53. data/support/install_command.sh +229 -0
  54. metadata +185 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a8dcb1c8c186b62fc6349e1ba9d7c0ed6ee055b6
4
+ data.tar.gz: 6651b86304ae0ee9ae96dfd862f28aa0f4f9257f
5
+ SHA512:
6
+ metadata.gz: 50e9eca0ce56ce29d66510a69361dd513436d114099ce55c311f81885104420027aafd97b2f2e27e591677fe669fe0ab1f7c4c790feae0bc8076ed7294f2cab3
7
+ data.tar.gz: b3a357238d315fcc6d8b14f4c84c68a8f3a2b6e83227ab93c4089f384e89c494cad1777791bc8efe22d9b34bfda55591b6807eee1dab7104082a75c0871749b7
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ tags
11
+ .ruby-version
12
+ .kitchen/
13
+ .kitchen.local.yml
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ AllCops:
2
+ Exclude:
3
+ - mixlib-install.gemspec
4
+ Style/AlignParameters:
5
+ EnforcedStyle: with_first_parameter
6
+ Style/HashSyntax:
7
+ EnforcedStyle: ruby19
8
+ Metrics/LineLength:
9
+ Exclude:
10
+ - spec/**/*.rb
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ sudo: false
3
+ rvm:
4
+ - 2.2
5
+ - 2.1
6
+ - 1.9.3
7
+
8
+ script: bundle exec rake ci
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,14 @@
1
+ This project is maintained by the contribution guidelines identified for
2
+ [chef](https://github.com/chef/chef) project. You can find the guidelines here:
3
+
4
+ https://github.com/chef/chef/blob/master/CONTRIBUTING.md
5
+
6
+ Pull requests in this project are merged when they have two :+1:s from maintainers.
7
+
8
+ ## Maintainers
9
+
10
+
11
+ - [Thom May](https://github.com/thommay)
12
+ - [Patrick Wright](https://github.com/patrick-wright)
13
+ - [Serdar Sutay](https://github.com/sersut)
14
+ - [Seth Chisamore](https://github.com/schisamo)
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "finstyle"
4
+
5
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/PRODUCT_MATRIX.md ADDED
@@ -0,0 +1,24 @@
1
+ | Product | Product Key |
2
+ | ------- | ------------ |
3
+ | Analytics Platform | analytics |
4
+ | Angry Omnibus Toolchain | angry-omnibus-toolchain |
5
+ | Angry Chef Client | angrychef |
6
+ | Chef Client | chef |
7
+ | Chef Backend | chef-backend |
8
+ | Chef Server High Availability addon | chef-ha |
9
+ | Chef Cloud Marketplace addon | chef-marketplace |
10
+ | Chef Server | chef-server |
11
+ | Chef Server Replication addon | chef-sync |
12
+ | Chef Development Kit | chefdk |
13
+ | Chef Compliance | compliance |
14
+ | Delivery | delivery |
15
+ | Delivery CLI | delivery-cli |
16
+ | Management Console | manage |
17
+ | Omnibus Toolchain | omnibus-toolchain |
18
+ | Enterprise Chef (legacy) | private-chef |
19
+ | Chef Push Server | push-client |
20
+ | Chef Push Server | push-server |
21
+ | Chef Server Reporting addon | reporting |
22
+ | Supermarket | supermarket |
23
+
24
+ Do not modify this file manually. It is automatically rendered via a rake task.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # Mixlib::Install
2
+
3
+ ## Usage
4
+
5
+ ### Get URL for specific platform and package version
6
+ ```ruby
7
+ options = {
8
+ channel: :current,
9
+ product_name: 'chef',
10
+ product_version: :latest,
11
+ platform: 'mac_os_x',
12
+ platform_version: '10.9',
13
+ architecture: 'x86_64'
14
+ }
15
+
16
+ artifact = Mixlib::Install.new(options).artifact_info
17
+ # => ArtifactInfo
18
+
19
+ artifact.url
20
+ # => "http://opscode-omnibus-packages-current.s3.amazonaws.com/mac_os_x/10.9/x86_64/chef-12.5.1%2B20151009083009-1.dmg"
21
+ ```
22
+
23
+ ### Get list of artifacts for all platforms given a package version
24
+ ```ruby
25
+ options = {
26
+ channel: :current,
27
+ product_name: 'chef',
28
+ product_version: :latest
29
+ }
30
+
31
+ artifacts = Mixlib::Install.new(options).artifact_info
32
+ # => Array<ArtifactInfo>
33
+
34
+ artifacts.first.url
35
+ # => "http://opscode-omnibus-packages-current.s3.amazonaws.com/mac_os_x/10.9/x86_64/chef-12.5.1%2B20151009083009-1.dmg"
36
+ ```
37
+
38
+ ## Unstable channel
39
+ The `:unstable` channel is currently only available when connected to Chef's internal network.
40
+ Configure Artifactory access by setting the following environment variables:
41
+ ```
42
+ export ARTIFACTORY_USERNAME='username'
43
+ export ARTIFACTORY_PASSWORD='password'
44
+ ```
45
+
46
+ ### Unstable channel specs
47
+ Some spec examples are tagged `:unstable` and can only run when connected to Chef's internal network. These are excluded by default. To run the `:unstable` tests run: `rake unstable`.
48
+
49
+ ## Contributing
50
+
51
+ 1. Fork it ( https://github.com/[my-github-username]/mixlib-install/fork )
52
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
53
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
54
+ 4. Push to the branch (`git push origin my-new-feature`)
55
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ require "bundler/gem_tasks"
2
+ require "finstyle"
3
+ require "rubocop/rake_task"
4
+ require "rspec/core/rake_task"
5
+
6
+ task default: :test
7
+
8
+ desc "Run specs"
9
+ RSpec::Core::RakeTask.new(:spec) do |spec|
10
+ spec.pattern = "spec/**/*_spec.rb"
11
+ end
12
+
13
+ desc "Run rubocop"
14
+ RuboCop::RakeTask.new do |task|
15
+ task.options << "--display-cop-names"
16
+ end
17
+
18
+ desc "Run all tests"
19
+ task test: [:rubocop, :spec, :unstable]
20
+
21
+ desc "Run unstable channel tests"
22
+ task "unstable" do
23
+ if ENV["ARTIFACTORY_USERNAME"].nil? || ENV["ARTIFACTORY_PASSWORD"].nil?
24
+ abort <<-EOS.gsub(/^\s+/, "")
25
+ Must set ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD environment
26
+ variables to run unstable tests
27
+ EOS
28
+ end
29
+ Rake::Task["rubocop"].invoke
30
+ system("bundle exec rspec -t unstable")
31
+ end
32
+
33
+ desc "Run tests for Travis CI"
34
+ task ci: [:rubocop, :spec]
35
+
36
+ desc "Render product matrix documentation"
37
+ task "matrix" do
38
+ require "mixlib/install/product"
39
+
40
+ doc_file = File.join(File.dirname(__FILE__), "PRODUCT_MATRIX.md")
41
+ puts "Updating doc file at: #{doc_file}"
42
+
43
+ File.open(doc_file, "w+") do |f|
44
+ f.puts("| Product | Product Key |")
45
+ f.puts("| ------- | ------------ |")
46
+ PRODUCT_MATRIX.products.sort.each do |p_key|
47
+ product = PRODUCT_MATRIX.lookup(p_key)
48
+ f.puts("| #{product.product_name} | #{p_key} |")
49
+ end
50
+ f.puts("")
51
+ f.puts("Do not modify this file manually. It is automatically rendered via a rake task.")
52
+ end
53
+ end
@@ -0,0 +1,2 @@
1
+ /Gemfile.lock
2
+ /.acceptance_logs/
@@ -0,0 +1,12 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "mixlib-install", path: "../"
4
+ gem "test-kitchen", github: "sersut/test-kitchen", branch: "sersut/mixlib-install-update"
5
+ gem "chef-acceptance", github: "chef/chef-acceptance"
6
+ gem "pry"
7
+
8
+ group(:development) do
9
+ gem "kitchen-vagrant"
10
+ gem "windows_chef_zero"
11
+ gem "winrm-transport"
12
+ end
@@ -0,0 +1 @@
1
+ name 'acceptance-cookbook'
@@ -0,0 +1,3 @@
1
+ execute "bundle exec kitchen destroy #{ENV["KITCHEN_INSTANCES"]}" do
2
+ cwd node['chef-acceptance']['suite-dir']
3
+ end
@@ -0,0 +1,3 @@
1
+ execute "bundle exec kitchen converge #{ENV["KITCHEN_INSTANCES"]}" do
2
+ cwd node['chef-acceptance']['suite-dir']
3
+ end
@@ -0,0 +1,3 @@
1
+ execute "bundle exec kitchen verify #{ENV["KITCHEN_INSTANCES"]}" do
2
+ cwd node['chef-acceptance']['suite-dir']
3
+ end
@@ -0,0 +1,41 @@
1
+ driver:
2
+ name: vagrant
3
+ provider: vmware_fusion
4
+ forward_agent: yes
5
+ customize:
6
+ numvcpus: 2
7
+ memsize: 1048
8
+
9
+ provisioner:
10
+ name: chef_zero
11
+
12
+ platforms:
13
+ - name: centos-6.5
14
+ run_list:
15
+ - name: debian-7.4
16
+ run_list:
17
+ - name: freebsd-10.0
18
+ run_list:
19
+ - name: ubuntu-14.04
20
+ run_list:
21
+ - name: macosx-10.10
22
+ driver:
23
+ box: chef/macosx-10.10 # private
24
+ - name: windows-server-2012r2-standard
25
+ driver:
26
+ box: chef/windows-server-2012r2-standard # private
27
+
28
+ suites:
29
+ - name: chef-current-install
30
+ provisioner:
31
+ product_name: chef
32
+ product_version: latest
33
+ channel: current
34
+ run_list:
35
+ - name: chefdk-current-install
36
+ excludes: [ 'freebsd-10.0' ]
37
+ provisioner:
38
+ product_name: chefdk
39
+ product_version: latest
40
+ channel: current
41
+ run_list:
@@ -0,0 +1 @@
1
+ name 'acceptance-cookbook'
@@ -0,0 +1,3 @@
1
+ execute "bundle exec kitchen destroy #{ENV["KITCHEN_INSTANCES"]}" do
2
+ cwd node['chef-acceptance']['suite-dir']
3
+ end
@@ -0,0 +1,3 @@
1
+ execute "bundle exec kitchen converge #{ENV["KITCHEN_INSTANCES"]}" do
2
+ cwd node['chef-acceptance']['suite-dir']
3
+ end
@@ -0,0 +1,3 @@
1
+ execute "bundle exec kitchen verify #{ENV["KITCHEN_INSTANCES"]}" do
2
+ cwd node['chef-acceptance']['suite-dir']
3
+ end
@@ -0,0 +1,41 @@
1
+ driver:
2
+ name: vagrant
3
+ provider: vmware_fusion
4
+ forward_agent: yes
5
+ customize:
6
+ numvcpus: 2
7
+ memsize: 1048
8
+
9
+ provisioner:
10
+ name: chef_zero
11
+
12
+ platforms:
13
+ - name: centos-6.5
14
+ run_list:
15
+ - name: debian-7.4
16
+ run_list:
17
+ - name: freebsd-10.0
18
+ run_list:
19
+ - name: ubuntu-14.04
20
+ run_list:
21
+ - name: macosx-10.10
22
+ driver:
23
+ box: chef/macosx-10.10 # private
24
+ - name: windows-server-2012r2-standard
25
+ driver:
26
+ box: chef/windows-server-2012r2-standard # private
27
+
28
+ suites:
29
+ - name: chef-unstable-install
30
+ provisioner:
31
+ product_name: chef
32
+ product_version: latest
33
+ channel: unstable
34
+ run_list:
35
+ - name: chefdk-unstable-install
36
+ excludes: [ 'freebsd-10.0' ]
37
+ provisioner:
38
+ product_name: chefdk
39
+ product_version: latest
40
+ channel: unstable
41
+ run_list:
@@ -0,0 +1,76 @@
1
+ #
2
+ # Author:: Patrick Wright (<patrick@chef.io>)
3
+ # Copyright:: Copyright (c) 2015 Chef, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ module Mixlib
20
+ class Install
21
+ class ArtifactInfo
22
+ attr_accessor :url
23
+ attr_accessor :md5
24
+ attr_accessor :sha256
25
+ attr_accessor :version
26
+
27
+ attr_accessor :platform
28
+ attr_accessor :platform_version
29
+ attr_accessor :architecture
30
+
31
+ def initialize(data)
32
+ @url = data[:url]
33
+ @md5 = data[:md5]
34
+ @sha256 = data[:sha256]
35
+ @version = data[:version]
36
+ @platform = data[:platform]
37
+ @platform_version = data[:platform_version]
38
+ @architecture = data[:architecture]
39
+ end
40
+
41
+ def self.from_json(json, platform_info)
42
+ ArtifactInfo.new(JSON.parse(json, symbolize_names: true).merge(platform_info))
43
+ end
44
+
45
+ def self.from_metadata_map(json)
46
+ artifacts = []
47
+
48
+ JSON.parse(json, symbolize_names: true).each do |p, p_data|
49
+ p_data.each do |pv, pv_data|
50
+ pv_data.each do |m, metadata|
51
+ artifacts << ArtifactInfo.new(metadata.merge(
52
+ platform: p,
53
+ platform_version: pv,
54
+ architecture: m
55
+ ))
56
+ end
57
+ end
58
+ end
59
+
60
+ artifacts
61
+ end
62
+
63
+ def to_hash
64
+ {
65
+ url: url,
66
+ md5: md5,
67
+ sha256: sha256,
68
+ version: version,
69
+ platform: platform,
70
+ platform_version: platform_version,
71
+ architecture: architecture
72
+ }
73
+ end
74
+ end
75
+ end
76
+ end