chef-dk 1.1.16 → 1.2.20

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -4
  3. data/Gemfile.lock +84 -68
  4. data/Rakefile +9 -0
  5. data/acceptance/Gemfile +3 -0
  6. data/acceptance/Gemfile.lock +43 -27
  7. data/chef-dk.gemspec +3 -2
  8. data/lib/chef-dk/command/install.rb +1 -1
  9. data/lib/chef-dk/exceptions.rb +10 -0
  10. data/lib/chef-dk/policyfile/chef_server_cookbook_source.rb +52 -8
  11. data/lib/chef-dk/policyfile/community_cookbook_source.rb +0 -1
  12. data/lib/chef-dk/policyfile/cookbook_location_specification.rb +2 -2
  13. data/lib/chef-dk/policyfile/dsl.rb +4 -2
  14. data/lib/chef-dk/policyfile/source_uri.rb +57 -0
  15. data/lib/chef-dk/policyfile/storage_config.rb +3 -0
  16. data/lib/chef-dk/policyfile_compiler.rb +4 -4
  17. data/lib/chef-dk/policyfile_services/install.rb +4 -2
  18. data/lib/chef-dk/skeletons/code_generator/files/default/delivery-project.toml +14 -3
  19. data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +3 -0
  20. data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +2 -0
  21. data/lib/chef-dk/skeletons/code_generator/templates/default/repo/gitignore.erb +121 -4
  22. data/lib/chef-dk/version.rb +1 -1
  23. data/omnibus_overrides.rb +2 -0
  24. data/spec/unit/command/generator_commands/cookbook_spec.rb +16 -5
  25. data/spec/unit/command/install_spec.rb +2 -2
  26. data/spec/unit/fixtures/cookbooks_api/chef_server_universe.json +56 -0
  27. data/spec/unit/fixtures/cookbooks_api/pruned_chef_server_universe.json +30 -0
  28. data/spec/unit/policyfile/chef_server_cookbook_source_spec.rb +29 -8
  29. data/spec/unit/policyfile/cookbook_location_specification_spec.rb +22 -0
  30. data/spec/unit/policyfile/source_uri_spec.rb +36 -0
  31. data/spec/unit/policyfile/storage_config_spec.rb +12 -0
  32. data/spec/unit/policyfile_services/push_spec.rb +16 -0
  33. data/version_policy.rb +9 -5
  34. metadata +40 -13
@@ -272,6 +272,28 @@ describe ChefDK::Policyfile::CookbookLocationSpecification do
272
272
  expect(cookbook_location_spec).to be_valid
273
273
  end
274
274
 
275
+ end
276
+
277
+ describe "when created with a chef_server source" do
278
+
279
+ let(:source_options) { { chef_server: "https://api.opscode.com/organizations/chef-oss-dev/cookbooks/my_cookbook/versions/2.0.0/download" } }
280
+
281
+ it "has a chef_server installer" do
282
+ expect(cookbook_location_spec.installer).to be_a_kind_of(CookbookOmnifetch::ChefServerLocation)
283
+ end
284
+
285
+ it "does not have a fixed version" do
286
+ expect(cookbook_location_spec.version_fixed?).to be false
287
+ end
288
+
289
+ it "is a mirror of a canonical upstream" do
290
+ expect(cookbook_location_spec.mirrors_canonical_upstream?).to be true
291
+ end
292
+
293
+ it "is valid" do
294
+ expect(cookbook_location_spec.errors.size).to eq(0)
295
+ expect(cookbook_location_spec).to be_valid
296
+ end
275
297
 
276
298
  end
277
299
  end
@@ -0,0 +1,36 @@
1
+ #
2
+ # Copyright:: Copyright (c) 2016 Chef Software 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 'spec_helper'
19
+
20
+ require 'chef-dk/policyfile/source_uri'
21
+
22
+ describe ChefDK::Policyfile::SourceURI do
23
+ subject { described_class.parse(source_uri) }
24
+
25
+ describe '#validate' do
26
+ context 'when the scheme is not https' do
27
+ let(:source_uri) { 'ftp://chef.example.com' }
28
+
29
+ it 'raises ChefDK::InvalidPolicyfileSourceURI' do
30
+ expect do
31
+ subject.validate
32
+ end.to raise_error(ChefDK::InvalidPolicyfileSourceURI)
33
+ end
34
+ end
35
+ end
36
+ end
@@ -115,6 +115,18 @@ describe ChefDK::Policyfile::StorageConfig do
115
115
 
116
116
  end
117
117
 
118
+ context "when the policyfile file name is actually a lockfile" do
119
+
120
+ before do
121
+ storage_config.use_policyfile("foo.lock.json")
122
+ end
123
+
124
+ it "uses the policyfile .rb file instead" do
125
+ expect(storage_config.policyfile_filename).to eq("foo.rb")
126
+ end
127
+
128
+ end
129
+
118
130
  end
119
131
 
120
132
 
@@ -87,6 +87,22 @@ describe ChefDK::PolicyfileServices::Push do
87
87
 
88
88
  end
89
89
 
90
+ context "when given a path to a Policyfile.lock.json instead of an rb" do
91
+
92
+ let(:policyfile_rb_name) { "MyPolicy.rb" }
93
+
94
+ let(:policyfile_lock_name) { "MyPolicy.lock.json" }
95
+
96
+ let(:push_service) { described_class.new(policyfile: policyfile_lock_name, policy_group: policy_group, ui: ui, config: config, root_dir: working_dir) }
97
+
98
+ it "loads the correct policyfile" do
99
+ storage_config = push_service.storage_config
100
+ expect(storage_config.policyfile_lock_filename).to eq(policyfile_lock_path)
101
+ expect(storage_config.policyfile_filename).to eq(policyfile_rb_path)
102
+ end
103
+
104
+ end
105
+
90
106
  context "when no lockfile is present" do
91
107
 
92
108
  it "errors out" do
@@ -47,9 +47,9 @@ OMNIBUS_OVERRIDES = {
47
47
  # software def so we don't need to override that
48
48
  "libzmq" => "4.0.5",
49
49
 
50
- ## These can float as they are frequently updated in a way that works for us
51
- #override "cacerts" =>"???",
52
- #override "openssl" =>"???",
50
+ # For 1.2 stable release only, pin to 1.1.0 of kitchen-dokken. After the 1.2
51
+ # release, unpin and bring in kitchen-dokken 2.x.
52
+ "kitchen-dokken" => "1.1.0"
53
53
  }
54
54
 
55
55
  #
@@ -60,7 +60,7 @@ OMNIBUS_OVERRIDES = {
60
60
  # name of the rubygem (gem list -re <rubygem name> gets us the latest version).
61
61
  #
62
62
  OMNIBUS_RUBYGEMS_AT_LATEST_VERSION = {
63
- #rubygems: "rubygems-update", # pinned to 2.6.4 until https://github.com/rubygems/rubygems/pull/1683 is released
63
+ rubygems: "rubygems-update",
64
64
  # bundler: "bundler", # pinned to 1.12.5 until we figure out how we're failing on 1.13.0
65
65
  }
66
66
 
@@ -76,7 +76,7 @@ ACCEPTABLE_OUTDATED_GEMS = [
76
76
  "activesupport", # anchored by outdated google-api-client
77
77
  "celluloid", # ridley requires 0.16.x
78
78
  "celluloid-io", # ridley requires 0.16.x
79
- "cucumber-core", # Until cucumber 2.0
79
+ "cucumber-core", # Until cucumber 2.0
80
80
  "fog-cloudatcost", # fog restricts this for probably no good reason
81
81
  "fog-dynect", # fog restricts this for probably no good reason
82
82
  "fog-google", # fog-google 0.2+ requires Ruby 2.0+, fog 2.0.0 will include it
@@ -88,6 +88,10 @@ ACCEPTABLE_OUTDATED_GEMS = [
88
88
  "rubocop", # cookstyle pins to 0.39.0 in 0.0.1
89
89
  "slop", # expected to disappear with pry 0.11
90
90
  "timers", # anchored by outdated celluloid
91
+ "github_changelog_generator", # we use a forked version that differs from rubygems
92
+ "addressable", # sawyer limits to < 2.6
93
+ "faraday", # ridely restrcits this 0.9.x
94
+ "thor", # berkshelf restricts this to < 0.19.2
91
95
 
92
96
  # We have a task called update_stable_channel_gems which scans and pins to the
93
97
  # latest released chef/chef-config/opscode-pushy-client but it pulls from the
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-dk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.16
4
+ version: 1.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel DeLeo
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-12-15 00:00:00.000000000 Z
13
+ date: 2017-01-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mixlib-cli
@@ -90,38 +90,58 @@ dependencies:
90
90
  version: '12.5'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: solve
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "<"
96
+ - !ruby/object:Gem::Version
97
+ version: '4.0'
98
+ - - ">"
99
+ - !ruby/object:Gem::Version
100
+ version: '2.0'
101
+ type: :runtime
102
+ prerelease: false
103
+ version_requirements: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "<"
106
+ - !ruby/object:Gem::Version
107
+ version: '4.0'
108
+ - - ">"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: addressable
93
113
  requirement: !ruby/object:Gem::Requirement
94
114
  requirements:
95
115
  - - ">="
96
116
  - !ruby/object:Gem::Version
97
- version: 2.0.1
117
+ version: 2.3.5
118
+ - - "<"
119
+ - !ruby/object:Gem::Version
120
+ version: '2.6'
98
121
  type: :runtime
99
122
  prerelease: false
100
123
  version_requirements: !ruby/object:Gem::Requirement
101
124
  requirements:
102
125
  - - ">="
103
126
  - !ruby/object:Gem::Version
104
- version: 2.0.1
127
+ version: 2.3.5
128
+ - - "<"
129
+ - !ruby/object:Gem::Version
130
+ version: '2.6'
105
131
  - !ruby/object:Gem::Dependency
106
132
  name: cookbook-omnifetch
107
133
  requirement: !ruby/object:Gem::Requirement
108
134
  requirements:
109
135
  - - "~>"
110
136
  - !ruby/object:Gem::Version
111
- version: '0.2'
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: 0.2.2
137
+ version: '0.5'
115
138
  type: :runtime
116
139
  prerelease: false
117
140
  version_requirements: !ruby/object:Gem::Requirement
118
141
  requirements:
119
142
  - - "~>"
120
143
  - !ruby/object:Gem::Version
121
- version: '0.2'
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 0.2.2
144
+ version: '0.5'
125
145
  - !ruby/object:Gem::Dependency
126
146
  name: diff-lcs
127
147
  requirement: !ruby/object:Gem::Requirement
@@ -326,6 +346,7 @@ files:
326
346
  - lib/chef-dk/policyfile/reports/table_printer.rb
327
347
  - lib/chef-dk/policyfile/reports/upload.rb
328
348
  - lib/chef-dk/policyfile/solution_dependencies.rb
349
+ - lib/chef-dk/policyfile/source_uri.rb
329
350
  - lib/chef-dk/policyfile/storage_config.rb
330
351
  - lib/chef-dk/policyfile/undo_record.rb
331
352
  - lib/chef-dk/policyfile/undo_stack.rb
@@ -484,6 +505,8 @@ files:
484
505
  - spec/unit/fixtures/cookbook_cache/foo-1.0.0/chefignore
485
506
  - spec/unit/fixtures/cookbook_cache/foo-1.0.0/metadata.rb
486
507
  - spec/unit/fixtures/cookbook_cache/foo-1.0.0/recipes/default.rb
508
+ - spec/unit/fixtures/cookbooks_api/chef_server_universe.json
509
+ - spec/unit/fixtures/cookbooks_api/pruned_chef_server_universe.json
487
510
  - spec/unit/fixtures/cookbooks_api/pruned_small_universe.json
488
511
  - spec/unit/fixtures/cookbooks_api/small_universe.json
489
512
  - spec/unit/fixtures/cookbooks_api/universe.json
@@ -564,6 +587,7 @@ files:
564
587
  - spec/unit/policyfile/reports/install_spec.rb
565
588
  - spec/unit/policyfile/reports/upload_spec.rb
566
589
  - spec/unit/policyfile/solution_dependencies_spec.rb
590
+ - spec/unit/policyfile/source_uri_spec.rb
567
591
  - spec/unit/policyfile/storage_config_spec.rb
568
592
  - spec/unit/policyfile/undo_record_spec.rb
569
593
  - spec/unit/policyfile/undo_stack_spec.rb
@@ -632,7 +656,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
632
656
  version: '0'
633
657
  requirements: []
634
658
  rubyforge_project:
635
- rubygems_version: 2.6.8
659
+ rubygems_version: 2.6.10
636
660
  signing_key:
637
661
  specification_version: 4
638
662
  summary: A streamlined development and deployment workflow for Chef platform.
@@ -711,6 +735,8 @@ test_files:
711
735
  - spec/unit/fixtures/cookbook_cache/foo-1.0.0/chefignore
712
736
  - spec/unit/fixtures/cookbook_cache/foo-1.0.0/metadata.rb
713
737
  - spec/unit/fixtures/cookbook_cache/foo-1.0.0/recipes/default.rb
738
+ - spec/unit/fixtures/cookbooks_api/chef_server_universe.json
739
+ - spec/unit/fixtures/cookbooks_api/pruned_chef_server_universe.json
714
740
  - spec/unit/fixtures/cookbooks_api/pruned_small_universe.json
715
741
  - spec/unit/fixtures/cookbooks_api/small_universe.json
716
742
  - spec/unit/fixtures/cookbooks_api/universe.json
@@ -791,6 +817,7 @@ test_files:
791
817
  - spec/unit/policyfile/reports/install_spec.rb
792
818
  - spec/unit/policyfile/reports/upload_spec.rb
793
819
  - spec/unit/policyfile/solution_dependencies_spec.rb
820
+ - spec/unit/policyfile/source_uri_spec.rb
794
821
  - spec/unit/policyfile/storage_config_spec.rb
795
822
  - spec/unit/policyfile/undo_record_spec.rb
796
823
  - spec/unit/policyfile/undo_stack_spec.rb