kitchen-vagrant 1.6.1 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00ea7c93ef421aaa716cae48e585432beecd3c09b655ee477c5a9bac35e058e5
4
- data.tar.gz: 26d491a7a3cb7213ab7c8bdee51eef727359f0ffe5d9ad9895ae0b7bea61c547
3
+ metadata.gz: 963b45a50eb74ce9d7bb16de1f63231ab44096c1459652be556bd7bc4c2d38d1
4
+ data.tar.gz: 5c0297d2879a29dd777b3976d6cda4167463fb9233dca540d848c5d741282145
5
5
  SHA512:
6
- metadata.gz: 7c35f0a8d81f3519a0a580163db11e744bb666e76664ff5646040c7c410bb4a988430c4a9aa639772946640dffe0f1f5f995a9488c5c218ee7835b485a0635d5
7
- data.tar.gz: 9f67a9cfccfa4796eba8a7cc088d2425ade9d80f7b817ccf9b7e46f9b2a9d2c692cb8537ce453baa453d019a7bb3fb31931c7f93f8e36296a35c97ec7a281c33
6
+ metadata.gz: a84c39b2411b0f6f80ad9c5c6dbeeab0eabae479c57c4cec4e7ce9f40f86466a9d7051176da592783dbf94b236bb049831ad61cabd7fc68201dd75baf5b75314
7
+ data.tar.gz: 4658e11b0222d2fcee0c69739f5e7eae88a7a64f54f43009c142572f7e7e35d922aa4630ab3e26b007d37fdc7bf80fb77b9f0aa77e8cbda0c8cb64f7ffb75d65
@@ -45,6 +45,10 @@ module Kitchen
45
45
 
46
46
  default_config :box_check_update, nil
47
47
 
48
+ default_config :box_auto_update, nil
49
+
50
+ default_config :box_auto_prune, nil
51
+
48
52
  default_config :box_download_insecure, nil
49
53
 
50
54
  default_config :box_download_ca_cert, nil
@@ -109,6 +113,8 @@ module Kitchen
109
113
  def create(state)
110
114
  create_vagrantfile
111
115
  run_pre_create_command
116
+ run_box_auto_update
117
+ run_box_auto_prune
112
118
  run_vagrant_up
113
119
  update_state(state)
114
120
  instance.transport.connection(state).wait_until_ready
@@ -172,6 +178,8 @@ module Kitchen
172
178
  def finalize_config!(instance)
173
179
  super
174
180
  finalize_vm_hostname!
181
+ finalize_box_auto_update!
182
+ finalize_box_auto_prune!
175
183
  finalize_pre_create_command!
176
184
  finalize_synced_folders!
177
185
  finalize_ca_cert!
@@ -299,6 +307,20 @@ module Kitchen
299
307
  end
300
308
  end
301
309
 
310
+ # Create vagrant command to update box to the latest version
311
+ def finalize_box_auto_update!
312
+ return if config[:box_auto_update].nil?
313
+
314
+ config[:box_auto_update] = "vagrant box update #{'--insecure ' if config[:box_download_insecure]}--box #{config[:box]}"
315
+ end
316
+
317
+ # Create vagrant command to remove older versions of the box
318
+ def finalize_box_auto_prune!
319
+ return if config[:box_auto_prune].nil?
320
+
321
+ config[:box_auto_prune] = "vagrant box prune --name #{config[:box]}"
322
+ end
323
+
302
324
  # Replaces any `{{vagrant_root}}` tokens in the pre create command.
303
325
  #
304
326
  # @api private
@@ -461,6 +483,20 @@ module Kitchen
461
483
  end
462
484
  # rubocop:enable Metrics/CyclomaticComplexity
463
485
 
486
+ # Tell vagrant to update vagrant box to latest version
487
+ def run_box_auto_update
488
+ if config[:box_auto_update]
489
+ run(config[:box_auto_update])
490
+ end
491
+ end
492
+
493
+ # Tell vagrant to remove older vagrant boxes
494
+ def run_box_auto_prune
495
+ if config[:box_auto_prune]
496
+ run(config[:box_auto_prune])
497
+ end
498
+ end
499
+
464
500
  # Runs a local command before `vagrant up` has been called.
465
501
  #
466
502
  # @api private
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Vagrant Kitchen driver
24
- VAGRANT_VERSION = "1.6.1".freeze
24
+ VAGRANT_VERSION = "1.7.0".freeze
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-15 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -117,7 +117,7 @@ homepage: https://github.com/test-kitchen/kitchen-vagrant/
117
117
  licenses:
118
118
  - Apache-2.0
119
119
  metadata: {}
120
- post_install_message:
120
+ post_install_message:
121
121
  rdoc_options: []
122
122
  require_paths:
123
123
  - lib
@@ -132,8 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.0.3
136
- signing_key:
135
+ rubygems_version: 3.1.2
136
+ signing_key:
137
137
  specification_version: 4
138
138
  summary: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
139
139
  test_files: []