chef-dk 3.2.30 → 3.3.23

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
  SHA256:
3
- metadata.gz: 3efb2de5668d591c97a8249d151858ac0b5c4a99f3416d3a77ccf34c947ccad7
4
- data.tar.gz: cbcd78e999d46bbd4b6ceee5dd582fb4aacac6bebd8ee02232cc20a3877193e5
3
+ metadata.gz: fb1392f9bbcca8710d63f569e35dc53ae39ec1778c15e3f824ffa878a745b6da
4
+ data.tar.gz: 0b46cbb065f92afa28a607057b05912ae736869321a32810329446473dab5dd5
5
5
  SHA512:
6
- metadata.gz: d17348847d440181aa411815919dc746e98e12e9a5bbaa5583aba34fd87ebee84eb6056d8e7682ccd5a0b25b9eb8be7319951c9350f83ca5ca737f50f51bd3c3
7
- data.tar.gz: ddbed79aa03dd2916abd115cf8fb4ff8f2397eb9a0499685b262f84709c468e32192e1fb44b02ceeb7a0dbae369d5f2bd8aa2137c10f2bf68edf95dd4cd962b8
6
+ metadata.gz: 9cae75e6c52b37ea3ffbc944b1dfa7e74d972b694cfbb486322083f030a536016868133aefc5d7dde03402f764bd1c81dddcf6923d1d6f0906363a610897e47a
7
+ data.tar.gz: bf42d40ac0cbd586118b18d5058507a45e8dd610b9a2313951ccae385077a251ec1d6fdfd188c480c72e167c3fa4f0cab223f5525eba75284921c73705b3e322
data/Gemfile CHANGED
@@ -47,14 +47,14 @@ group(:omnibus_package) do
47
47
  gem "chef-provisioning", ">= 2.7.1", group: :provisioning
48
48
  gem "chef-provisioning-aws", ">= 3.0.2", group: :provisioning
49
49
  gem "chef-provisioning-fog", ">= 0.26.1", group: :provisioning
50
- gem "chef-vault", ">= 3.3.0"
50
+ gem "chef-vault", ">= 3.4.1"
51
51
  # Expeditor manages the version of chef released to Rubygems. We only release 'stable' chef
52
52
  # gems to Rubygems now, so letting this float on latest should always give us the latest
53
53
  # stable release. May have to re-pin around major version bumping time, or during patch
54
54
  # fixes.
55
- gem "chef", ">= 14.0"
55
+ gem "chef", "= 14.5.33"
56
56
  gem "cheffish", ">= 14.0.1"
57
- gem "chefspec", ">= 7.2.1"
57
+ gem "chefspec", ">= 7.3.0"
58
58
  gem "fauxhai", ">= 6.5.0"
59
59
  gem "inspec", ">= 2.2.55"
60
60
  gem "kitchen-azurerm", ">= 0.14"
@@ -105,9 +105,6 @@ group(:omnibus_package) do
105
105
  gem "winrm-elevated"
106
106
  gem "cucumber"
107
107
  gem "stove"
108
-
109
- # TODO Remove this after https://github.com/fog/fog-openstack/issues/420 is fixed
110
- gem "fog-openstack", "< 0.2.0"
111
108
  end
112
109
 
113
110
  # Everything except AIX
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chef-dk (3.2.30)
4
+ chef-dk (3.3.23)
5
5
  addressable (>= 2.3.5, < 2.6)
6
6
  chef (~> 14.0)
7
7
  chef-provisioning (~> 2.0)
@@ -30,13 +30,13 @@ GEM
30
30
  mixlib-shellout (~> 2.0)
31
31
  artifactory (2.8.2)
32
32
  ast (2.4.0)
33
- aws-sdk (2.11.120)
34
- aws-sdk-resources (= 2.11.120)
35
- aws-sdk-core (2.11.120)
33
+ aws-sdk (2.11.136)
34
+ aws-sdk-resources (= 2.11.136)
35
+ aws-sdk-core (2.11.136)
36
36
  aws-sigv4 (~> 1.0)
37
37
  jmespath (~> 1.0)
38
- aws-sdk-resources (2.11.120)
39
- aws-sdk-core (= 2.11.120)
38
+ aws-sdk-resources (2.11.136)
39
+ aws-sdk-core (= 2.11.136)
40
40
  aws-sigv4 (1.0.3)
41
41
  axiom-types (0.1.1)
42
42
  descendants_tracker (~> 0.0.4)
@@ -44,9 +44,9 @@ GEM
44
44
  thread_safe (~> 0.3, >= 0.3.1)
45
45
  azure_graph_rbac (0.17.0)
46
46
  ms_rest_azure (~> 0.11.0)
47
- azure_mgmt_network (0.17.1)
47
+ azure_mgmt_network (0.17.3)
48
48
  ms_rest_azure (~> 0.11.0)
49
- azure_mgmt_resources (0.17.0)
49
+ azure_mgmt_resources (0.17.1)
50
50
  ms_rest_azure (~> 0.11.0)
51
51
  backports (3.11.4)
52
52
  berkshelf (7.0.6)
@@ -66,10 +66,10 @@ GEM
66
66
  debug_inspector (>= 0.0.1)
67
67
  builder (3.2.3)
68
68
  byebug (10.0.2)
69
- chef (14.4.56)
69
+ chef (14.5.33)
70
70
  addressable
71
71
  bundler (>= 1.10)
72
- chef-config (= 14.4.56)
72
+ chef-config (= 14.5.33)
73
73
  chef-zero (>= 13.0)
74
74
  diff-lcs (~> 1.2, >= 1.2.4)
75
75
  erubis (~> 2.7)
@@ -97,10 +97,10 @@ GEM
97
97
  specinfra (~> 2.10)
98
98
  syslog-logger (~> 1.6)
99
99
  uuidtools (~> 2.1.5)
100
- chef (14.4.56-universal-mingw32)
100
+ chef (14.5.33-universal-mingw32)
101
101
  addressable
102
102
  bundler (>= 1.10)
103
- chef-config (= 14.4.56)
103
+ chef-config (= 14.5.33)
104
104
  chef-zero (>= 13.0)
105
105
  diff-lcs (~> 1.2, >= 1.2.4)
106
106
  erubis (~> 2.7)
@@ -155,7 +155,7 @@ GEM
155
155
  toml-rb
156
156
  train
157
157
  tty-spinner
158
- chef-config (14.4.56)
158
+ chef-config (14.5.33)
159
159
  addressable
160
160
  fuzzyurl
161
161
  mixlib-config (>= 2.2.12, < 3.0)
@@ -171,7 +171,7 @@ GEM
171
171
  winrm (~> 2.0)
172
172
  winrm-elevated (~> 1.0)
173
173
  winrm-fs (~> 1.0)
174
- chef-provisioning-aws (3.0.4)
174
+ chef-provisioning-aws (3.0.6)
175
175
  aws-sdk (>= 2.2.18, < 3.0)
176
176
  chef-provisioning (>= 1.0, < 3.0)
177
177
  retryable (~> 2.0, >= 2.0.1)
@@ -194,7 +194,7 @@ GEM
194
194
  concurrent-ruby (~> 1.0)
195
195
  ffi-yajl (~> 2.2)
196
196
  http (~> 2.2)
197
- chef-vault (3.3.0)
197
+ chef-vault (3.4.2)
198
198
  chef-zero (14.0.6)
199
199
  ffi-yajl (~> 2.2)
200
200
  hashie (>= 2.0, < 4.0)
@@ -204,8 +204,8 @@ GEM
204
204
  cheffish (14.0.1)
205
205
  chef-zero (~> 14.0)
206
206
  net-ssh
207
- chefspec (7.2.1)
208
- chef (>= 12.14.89)
207
+ chefspec (7.3.2)
208
+ chef (>= 12.16.42)
209
209
  fauxhai (>= 4)
210
210
  rspec (~> 3.0)
211
211
  chefstyle (0.10.0)
@@ -229,10 +229,10 @@ GEM
229
229
  gherkin (~> 5.1.0)
230
230
  multi_json (>= 1.7.5, < 2.0)
231
231
  multi_test (>= 0.1.2)
232
- cucumber-core (3.2.0)
232
+ cucumber-core (3.2.1)
233
233
  backports (>= 3.8.0)
234
234
  cucumber-tag_expressions (~> 1.1.0)
235
- gherkin (>= 5.0.0)
235
+ gherkin (~> 5.0)
236
236
  cucumber-expressions (6.0.1)
237
237
  cucumber-tag_expressions (1.1.1)
238
238
  cucumber-wire (0.0.1)
@@ -265,7 +265,7 @@ GEM
265
265
  equatable (0.5.0)
266
266
  erubis (2.7.0)
267
267
  excon (0.62.0)
268
- faraday (0.15.2)
268
+ faraday (0.15.3)
269
269
  multipart-post (>= 1.2, < 3)
270
270
  faraday-cookie_jar (0.0.6)
271
271
  faraday (>= 0.7.4)
@@ -308,8 +308,8 @@ GEM
308
308
  fog-json (1.2.0)
309
309
  fog-core
310
310
  multi_json (~> 1.10)
311
- fog-openstack (0.1.27)
312
- fog-core (~> 1.45.0)
311
+ fog-openstack (0.3.3)
312
+ fog-core (>= 1.45, <= 2.1.0)
313
313
  fog-json (>= 1.0)
314
314
  ipaddress (>= 0.8)
315
315
  fog-rackspace (0.1.6)
@@ -323,13 +323,14 @@ GEM
323
323
  fog-softlayer (1.1.4)
324
324
  fog-core
325
325
  fog-json
326
- fog-xenserver (0.3.0)
326
+ fog-xenserver (1.0.0)
327
327
  fog-core
328
328
  fog-xml
329
+ xmlrpc
329
330
  fog-xml (0.1.3)
330
331
  fog-core
331
332
  nokogiri (>= 1.5.11, < 2.0.0)
332
- foodcritic (14.0.0)
333
+ foodcritic (14.1.0)
333
334
  cucumber-core (>= 1.3)
334
335
  erubis
335
336
  ffi-yajl (~> 2.0)
@@ -388,7 +389,7 @@ GEM
388
389
  ice_nine (0.11.2)
389
390
  inifile (3.0.0)
390
391
  iniparse (1.4.4)
391
- inspec (2.2.70)
392
+ inspec (2.2.112)
392
393
  addressable (~> 2.4)
393
394
  faraday (>= 0.9.0)
394
395
  faraday_middleware (~> 0.12.2)
@@ -397,17 +398,18 @@ GEM
397
398
  json (>= 1.8, < 3.0)
398
399
  method_source (~> 0.8)
399
400
  mixlib-log
401
+ multipart-post
400
402
  parallel (~> 1.9)
401
403
  parslet (~> 1.5)
402
404
  pry (~> 0)
403
405
  rspec (~> 3)
404
406
  rspec-its (~> 1.2)
405
- rubyzip (~> 1.1)
407
+ rubyzip (~> 1.2, >= 1.2.2)
406
408
  semverse
407
409
  sslshake (~> 1.2)
408
410
  thor (~> 0.20)
409
411
  tomlrb (~> 1.2)
410
- train (~> 1.4, >= 1.4.15)
412
+ train (~> 1.4, >= 1.4.37)
411
413
  ipaddress (0.8.3)
412
414
  iso8601 (0.11.0)
413
415
  jmespath (1.4.0)
@@ -438,11 +440,11 @@ GEM
438
440
  test-kitchen
439
441
  kitchen-hyperv (0.5.1)
440
442
  test-kitchen (~> 1.4)
441
- kitchen-inspec (0.23.1)
443
+ kitchen-inspec (0.24.0)
442
444
  hashie (~> 3.4)
443
445
  inspec (>= 0.34.0, < 3.0.0)
444
446
  test-kitchen (~> 1.6)
445
- kitchen-vagrant (1.3.3)
447
+ kitchen-vagrant (1.3.4)
446
448
  test-kitchen (~> 1.4)
447
449
  knife-acl (1.0.3)
448
450
  knife-cloud (1.2.1)
@@ -534,7 +536,7 @@ GEM
534
536
  net-ssh-multi (1.2.1)
535
537
  net-ssh (>= 2.6.5)
536
538
  net-ssh-gateway (>= 1.2.0)
537
- net-telnet (0.2.0)
539
+ net-telnet (0.1.1)
538
540
  netaddr (1.5.1)
539
541
  nokogiri (1.8.4)
540
542
  mini_portile2 (~> 2.3.0)
@@ -546,9 +548,9 @@ GEM
546
548
  notiffany (0.1.1)
547
549
  nenv (~> 0.1)
548
550
  shellany (~> 0.0)
549
- octokit (4.11.0)
551
+ octokit (4.12.0)
550
552
  sawyer (~> 0.8.0, >= 0.5.3)
551
- ohai (14.4.2)
553
+ ohai (14.5.4)
552
554
  chef-config (>= 12.8, < 15)
553
555
  ffi (~> 1.9)
554
556
  ffi-yajl (~> 2.2)
@@ -591,9 +593,9 @@ GEM
591
593
  binding_of_caller (>= 0.7)
592
594
  pry (>= 0.9.11)
593
595
  public_suffix (3.0.3)
594
- r18n-core (3.1.1)
595
- r18n-desktop (3.1.1)
596
- r18n-core (= 3.1.1)
596
+ r18n-core (3.1.2)
597
+ r18n-desktop (3.1.2)
598
+ r18n-core (= 3.1.2)
597
599
  rack (2.0.5)
598
600
  rainbow (3.0.0)
599
601
  rake (12.3.1)
@@ -647,7 +649,7 @@ GEM
647
649
  ruby-shadow (2.5.0)
648
650
  ruby_dep (1.5.0)
649
651
  rubyntlm (0.6.2)
650
- rubyzip (1.2.1)
652
+ rubyzip (1.2.2)
651
653
  rufus-lru (1.1.0)
652
654
  sawyer (0.8.1)
653
655
  addressable (>= 2.3.5, < 2.6)
@@ -660,7 +662,7 @@ GEM
660
662
  specinfra (~> 2.72)
661
663
  sfl (2.3)
662
664
  shellany (0.0.1)
663
- signet (0.9.1)
665
+ signet (0.10.0)
664
666
  addressable (~> 2.3)
665
667
  faraday (~> 0.9)
666
668
  jwt (>= 1.5, < 3.0)
@@ -669,10 +671,10 @@ GEM
669
671
  solve (4.0.0)
670
672
  molinillo (~> 0.6)
671
673
  semverse (>= 1.1, < 3.0)
672
- specinfra (2.76.1)
674
+ specinfra (2.76.2)
673
675
  net-scp
674
676
  net-ssh (>= 2.7)
675
- net-telnet
677
+ net-telnet (= 0.1.1)
676
678
  sfl
677
679
  sshkey (1.9.0)
678
680
  sslshake (1.2.0)
@@ -698,7 +700,7 @@ GEM
698
700
  toml-rb (1.1.2)
699
701
  citrus (~> 3.0, > 3.0)
700
702
  tomlrb (1.2.7)
701
- train (1.4.35)
703
+ train (1.4.37)
702
704
  aws-sdk (~> 2)
703
705
  azure_graph_rbac (~> 0.16)
704
706
  azure_mgmt_resources (~> 0.15)
@@ -773,12 +775,13 @@ GEM
773
775
  winrm-elevated (1.1.0)
774
776
  winrm (~> 2.0)
775
777
  winrm-fs (~> 1.0)
776
- winrm-fs (1.2.1)
778
+ winrm-fs (1.3.0)
777
779
  erubis (~> 2.7)
778
780
  logging (>= 1.6.1, < 3.0)
779
781
  rubyzip (~> 1.1)
780
782
  winrm (~> 2.0)
781
783
  wmi-lite (1.0.0)
784
+ xmlrpc (0.3.0)
782
785
  yard (0.9.16)
783
786
 
784
787
  PLATFORMS
@@ -791,16 +794,16 @@ DEPENDENCIES
791
794
  artifactory
792
795
  berkshelf (>= 7.0.5)
793
796
  bundler
794
- chef (>= 14.0)
797
+ chef (= 14.5.33)
795
798
  chef-apply
796
799
  chef-dk!
797
800
  chef-provisioning (>= 2.7.1)
798
801
  chef-provisioning-aws (>= 3.0.2)
799
802
  chef-provisioning-fog (>= 0.26.1)
800
803
  chef-sugar
801
- chef-vault (>= 3.3.0)
804
+ chef-vault (>= 3.4.1)
802
805
  cheffish (>= 14.0.1)
803
- chefspec (>= 7.2.1)
806
+ chefspec (>= 7.3.0)
804
807
  chefstyle
805
808
  cookstyle (>= 2.0.0)
806
809
  cucumber
@@ -810,7 +813,6 @@ DEPENDENCIES
810
813
  fauxhai (>= 6.5.0)
811
814
  ffi-libarchive
812
815
  ffi-rzmq-core
813
- fog-openstack (< 0.2.0)
814
816
  foodcritic (>= 12.1)
815
817
  guard
816
818
  inspec (>= 2.2.55)
@@ -868,4 +870,4 @@ DEPENDENCIES
868
870
  yard
869
871
 
870
872
  BUNDLED WITH
871
- 1.16.4
873
+ 1.16.5
@@ -12,13 +12,13 @@ GEM
12
12
  addressable (2.5.2)
13
13
  public_suffix (>= 2.0.2, < 4.0)
14
14
  artifactory (2.8.2)
15
- aws-sdk (2.11.120)
16
- aws-sdk-resources (= 2.11.120)
17
- aws-sdk-core (2.11.120)
15
+ aws-sdk (2.11.126)
16
+ aws-sdk-resources (= 2.11.126)
17
+ aws-sdk-core (2.11.126)
18
18
  aws-sigv4 (~> 1.0)
19
19
  jmespath (~> 1.0)
20
- aws-sdk-resources (2.11.120)
21
- aws-sdk-core (= 2.11.120)
20
+ aws-sdk-resources (2.11.126)
21
+ aws-sdk-core (= 2.11.126)
22
22
  aws-sigv4 (1.0.3)
23
23
  berkshelf (6.3.4)
24
24
  buff-config (~> 2.0)
@@ -182,7 +182,7 @@ GEM
182
182
  net-telnet (0.2.0)
183
183
  nio4r (2.3.1)
184
184
  nori (2.6.0)
185
- octokit (4.10.0)
185
+ octokit (4.11.0)
186
186
  sawyer (~> 0.8.0, >= 0.5.3)
187
187
  ohai (8.26.1)
188
188
  chef-config (>= 12.5.0.alpha.1, < 14)
@@ -245,7 +245,7 @@ GEM
245
245
  builder (< 4)
246
246
  rspec-core (>= 2, < 4, != 2.12.0)
247
247
  rubyntlm (0.6.2)
248
- rubyzip (1.2.1)
248
+ rubyzip (1.2.2)
249
249
  safe_yaml (1.0.4)
250
250
  sawyer (0.8.1)
251
251
  addressable (>= 2.3.5, < 2.6)
@@ -306,7 +306,7 @@ GEM
306
306
  winrm-elevated (1.1.0)
307
307
  winrm (~> 2.0)
308
308
  winrm-fs (~> 1.0)
309
- winrm-fs (1.2.1)
309
+ winrm-fs (1.3.0)
310
310
  erubis (~> 2.7)
311
311
  logging (>= 1.6.1, < 3.0)
312
312
  rubyzip (~> 1.1)
@@ -46,14 +46,14 @@ module ChefDK
46
46
  generators << GeneratorCommand.new(name, class_name, description)
47
47
  end
48
48
 
49
- generator(:app, :App, "Generate an application repo")
49
+ generator(:app, :App, "Generate an application repo - DEPRECATED")
50
50
  generator(:cookbook, :Cookbook, "Generate a single cookbook")
51
51
  generator(:recipe, :Recipe, "Generate a new recipe")
52
52
  generator(:attribute, :Attribute, "Generate an attributes file")
53
53
  generator(:template, :Template, "Generate a file template")
54
54
  generator(:file, :CookbookFile, "Generate a cookbook file")
55
55
  generator(:helpers, :Helpers, "Generate a cookbook helper file in libraries")
56
- generator(:lwrp, :Resource, "Generate a custom resource")
56
+ generator(:lwrp, :Resource, "Generate a lightweight resource provider (LWRP) - DEPRECATED")
57
57
  generator(:resource, :Resource, "Generate a custom resource")
58
58
  generator(:repo, :Repo, "Generate a Chef code repository")
59
59
  generator(:policyfile, :Policyfile, "Generate a Policyfile for use with the install/push commands")
@@ -86,6 +86,7 @@ E
86
86
 
87
87
  def run(params)
88
88
  if ( generator_spec = generator_for(params[0]) )
89
+ puts "WARNING: The command 'chef generator #{params[0]}' is deprecated and will be removed from the next major release of Chef DK / Workstation (April 2019)\n\n" if %w{lwrp app}.include?(params[0])
89
90
  params.shift
90
91
  generator = GeneratorCommands.build(generator_spec.class_name, params)
91
92
  generator.run
@@ -67,6 +67,12 @@ BANNER
67
67
  default: false,
68
68
  boolean: true
69
69
 
70
+ option :exclude_deps,
71
+ long: "--exclude-deps",
72
+ description: "Only update cookbooks explicitely mentioned on the command line",
73
+ boolean: true,
74
+ default: false
75
+
70
76
  attr_reader :policyfile_relative_path
71
77
 
72
78
  attr_accessor :ui
@@ -84,7 +90,7 @@ BANNER
84
90
  def run(params = [])
85
91
  return 1 unless apply_params!(params)
86
92
  attributes_updater.run
87
- installer.run(@cookbooks_to_update) unless update_attributes_only?
93
+ installer.run(@cookbooks_to_update, config[:exclude_deps]) unless update_attributes_only?
88
94
  0
89
95
  rescue PolicyfileServiceError => e
90
96
  handle_error(e)
@@ -41,6 +41,7 @@ module ChefDK
41
41
  @ui = ui || UI.null
42
42
  @policy_document_native_api = policy_document_native_api
43
43
 
44
+ @policy_lock_for_transport = nil
44
45
  @cookbook_versions_for_policy = nil
45
46
  end
46
47
 
@@ -49,7 +50,7 @@ module ChefDK
49
50
  end
50
51
 
51
52
  def upload
52
- ui.msg("Uploading policy to policy group #{policy_group}")
53
+ ui.msg("Uploading policy #{policy_name} (#{short_revision_id}) to policy group #{policy_group}")
53
54
 
54
55
  if !using_policy_document_native_api?
55
56
  ui.msg(<<-DRAGONS)
@@ -73,7 +74,7 @@ DRAGONS
73
74
  end
74
75
 
75
76
  def upload_policy_native
76
- http_client.put("/policy_groups/#{policy_group}/policies/#{policy_name}", policyfile_lock.to_lock)
77
+ http_client.put("/policy_groups/#{policy_group}/policies/#{policy_name}", policy_lock_for_transport)
77
78
  end
78
79
 
79
80
  def data_bag_create
@@ -84,7 +85,7 @@ DRAGONS
84
85
 
85
86
  def data_bag_item_create
86
87
  policy_id = "#{policy_name}-#{policy_group}"
87
- lock_data = policyfile_lock.to_lock.dup
88
+ lock_data = policy_lock_for_transport.dup
88
89
 
89
90
  lock_data["id"] = policy_id
90
91
 
@@ -180,6 +181,14 @@ DRAGONS
180
181
 
181
182
  private
182
183
 
184
+ def short_revision_id
185
+ policy_lock_for_transport["revision_id"][0, 10]
186
+ end
187
+
188
+ def policy_lock_for_transport
189
+ @policy_lock_for_transport ||= policyfile_lock.to_lock
190
+ end
191
+
183
192
  def list_cookbooks_url
184
193
  if using_policy_document_native_api?
185
194
  "cookbook_artifacts?num_versions=all"
@@ -22,6 +22,7 @@ require "chef-dk/service_exceptions"
22
22
  require "chef-dk/policyfile_compiler"
23
23
  require "chef-dk/policyfile/storage_config"
24
24
  require "chef-dk/policyfile_lock"
25
+ require "chef-dk/policyfile/lock_applier"
25
26
 
26
27
  module ChefDK
27
28
  module PolicyfileServices
@@ -49,7 +50,7 @@ module ChefDK
49
50
  @policyfile_compiler = nil
50
51
  end
51
52
 
52
- def run(cookbooks_to_update = [])
53
+ def run(cookbooks_to_update = [], exclude_deps = false)
53
54
  unless File.exist?(policyfile_expanded_path)
54
55
  # TODO: suggest next step. Add a generator/init command? Specify path to Policyfile.rb?
55
56
  # See card CC-232
@@ -61,7 +62,7 @@ module ChefDK
61
62
  elsif cookbooks_to_update.empty? # means update everything
62
63
  generate_lock_and_install
63
64
  else
64
- update_lock_and_install(cookbooks_to_update)
65
+ update_lock_and_install(cookbooks_to_update, exclude_deps)
65
66
  end
66
67
  end
67
68
 
@@ -113,9 +114,13 @@ module ChefDK
113
114
  raise PolicyfileInstallError.new("Failed to generate Policyfile.lock", error)
114
115
  end
115
116
 
116
- def update_lock_and_install(cookbooks_to_update)
117
- ui.msg "Updating #{cookbooks_to_update.join(',')} cookbooks"
118
- to_update = policyfile_lock.solution_dependencies.transitive_deps(cookbooks_to_update)
117
+ def update_lock_and_install(cookbooks_to_update, exclude_deps)
118
+ ui.msg "Updating #{cookbooks_to_update.join(',')} cookbooks #{exclude_deps ? '(excluding dependencies)' : ''}"
119
+ to_update = if exclude_deps
120
+ cookbooks_to_update
121
+ else
122
+ policyfile_lock.solution_dependencies.transitive_deps(cookbooks_to_update)
123
+ end
119
124
  prepare_constraints_for_update(to_update)
120
125
  prepare_constraints_for_policies
121
126
  generate_lock_and_install
@@ -5,4 +5,4 @@ maintainer_email 'dev@chef.io'
5
5
  license 'Apache-2.0'
6
6
  description 'Generates Chef code for Chef DK'
7
7
  version '0.1.0'
8
- chef_version '>= 12.0'
8
+ chef_version '>= 13.0'
@@ -3,7 +3,7 @@ maintainer '<%= copyright_holder %>'
3
3
  maintainer_email '<%= email %>'
4
4
  license '<%= license %>'
5
5
  version '0.1.0'
6
- chef_version '>= 12.14' if respond_to?(:chef_version)
6
+ chef_version '>= 13.0'
7
7
  <% if build_cookbook_parent_is_cookbook -%>
8
8
 
9
9
  depends 'delivery-truck'
@@ -5,7 +5,7 @@ license '<%= @spdx_license %>'
5
5
  description 'Installs/Configures <%= cookbook_name %>'
6
6
  long_description 'Installs/Configures <%= cookbook_name %>'
7
7
  version '0.1.0'
8
- chef_version '>= 12.14' if respond_to?(:chef_version)
8
+ chef_version '>= 13.0'
9
9
 
10
10
  # The `issues_url` points to the location where issues for this cookbook are
11
11
  # tracked. A `View Issues` link will be displayed on this cookbook's page when
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefDK
19
- VERSION = "3.2.30"
19
+ VERSION = "3.3.23"
20
20
  end
@@ -198,7 +198,7 @@ maintainer 'The Authors'
198
198
  maintainer_email 'you@example.com'
199
199
  license 'all_rights'
200
200
  version '0.1.0'
201
- chef_version '>= 12.14' if respond_to?(:chef_version)
201
+ chef_version '>= 13.0'
202
202
 
203
203
  depends 'delivery-truck'
204
204
  METADATA
@@ -28,6 +28,7 @@ describe ChefDK::Policyfile::Uploader do
28
28
  {
29
29
  "name" => "example",
30
30
  "run_list" => [ "recipe[omnibus::default]" ],
31
+ "revision_id" => "f4b29d87c36de67cbfd9aa3147df77cebf9f719e8c884036b3cf34ba94773ca5",
31
32
  "cookbook_locks" => {
32
33
  "omnibus" => {
33
34
  "version" => "2.2.0",
@@ -104,12 +104,25 @@ EOH
104
104
  }.to_json
105
105
  end
106
106
 
107
+ shared_examples "regular update operation" do
108
+ it "allows update on cookbook to update" do
109
+ expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["top-level"].version_constraint.to_s).to eq(">= 0.0.0")
110
+ end
111
+
112
+ it "does not update unrelated cookbooks" do
113
+ expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["top-level-bis"].version_constraint.to_s).to eq("= 1.0.0")
114
+ end
115
+
116
+ end
117
+
107
118
  context "when given one cookbook to update" do
108
119
  before(:each) do
109
120
  # stub access to Policyfile.rb and Policyfile.lock.json
121
+ allow(File).to receive(:exist?).and_call_original
110
122
  expect(File).to receive(:exist?).at_least(:once).with(policyfile_rb_path).and_return(true)
111
123
  expect(File).to receive(:exist?).at_least(:once).with(policyfile_lock_path).and_return(true)
112
124
 
125
+ allow(IO).to receive(:read).and_call_original
113
126
  expect(IO).to receive(:read).with(policyfile_rb_path).and_return(policyfile_content)
114
127
  expect(IO).to receive(:read).with(policyfile_lock_path).and_return(policyfile_lock_content)
115
128
 
@@ -117,22 +130,31 @@ EOH
117
130
  # elsewhere. We only check constraints changes
118
131
  expect(install_service).to receive(:generate_lock_and_install)
119
132
 
120
- expect { install_service.run(["top-level"]) }.not_to raise_error
121
- end
122
- it "allows update on cookbook to update" do
123
- expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["top-level"].version_constraint.to_s).to eq(">= 0.0.0")
133
+ expect { install_service.run(["top-level"], exclude_deps) }.not_to raise_error
124
134
  end
125
135
 
126
- it "does not update unrelated cookbooks" do
127
- expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["top-level-bis"].version_constraint.to_s).to eq("= 1.0.0")
128
- end
136
+ context "without exclude-deps flag" do
137
+ let(:exclude_deps) { false }
138
+
139
+ it_behaves_like "regular update operation"
140
+
141
+ it "allows update on dependencies" do
142
+ expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["a"]).to be_nil
143
+ end
129
144
 
130
- it "allows update on dependencies" do
131
- expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["a"]).to be_nil
145
+ it "preserves existing constraints from Policyfile" do
146
+ expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["b"].version_constraint.to_s).to eq(">= 1.2.3")
147
+ end
132
148
  end
133
149
 
134
- it "preserves existing constraints from Policyfile" do
135
- expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["b"].version_constraint.to_s).to eq(">= 1.2.3")
150
+ context "with exclude-deps flag" do
151
+ let(:exclude_deps) { true }
152
+
153
+ it_behaves_like "regular update operation"
154
+
155
+ it "does not allow update on dependencies" do
156
+ expect(install_service.policyfile_compiler.dsl.cookbook_location_specs["a"].version_constraint.to_s).to eq("= 2.1.0")
157
+ end
136
158
  end
137
159
 
138
160
  end
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: 3.2.30
4
+ version: 3.3.23
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: 2018-08-30 00:00:00.000000000 Z
13
+ date: 2018-09-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mixlib-cli