vagrant-save 0.2.6 → 0.2.7

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: 7010292589cb6518cd03465ce38d51046da2d3ac
4
- data.tar.gz: 8344af243ce9131dc4c6e0385d8a0318b408a345
3
+ metadata.gz: 42ff5bfda3de74ddd3d9ffe0b0904512acf86592
4
+ data.tar.gz: 839db02248a34e55080b454477d3419ec4458e29
5
5
  SHA512:
6
- metadata.gz: d9286f323ff4c4bfe6e7ea0a7345dc00713d43f37632071304262bb80f7a2f7505b702723d4fba0a2e0dcfa211b8694e26e173de1b0b2e63ff7e7996676b0510
7
- data.tar.gz: 07fedfbc0e783917f02b9e2a7f824def950d6abc7a0db7aa2d9e4a71a3d7e2b29358e50d8049a7fad6b69772dea4fae53eadabd571bc6cd99e9c27008eb849ce
6
+ metadata.gz: dd5b662c604e5202c2b53f3a1c2f7dc1daaaeeaf01f0356aab9296f1f40581b840b8ca20a7724247cc6ca9c3059638393602e066f0c9e94a7aa9ee54a3e653d6
7
+ data.tar.gz: 0f953acedac4e051360ff279ad91239d3891914eb723baa4f5280f4d7d65fd991ff64f72cb94d15284228a36c9b82be5b9318ed33a0d51993f2aef9cf43a6cce
data/Gemfile CHANGED
@@ -1,11 +1,11 @@
1
- source 'https://rubygems.org'
2
-
3
- group :development do
4
- gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
5
- end
6
-
7
- gem 'vagrant-export', '>= 0.2.3', git: 'https://github.com/trenker/vagrant-export.git'
8
-
9
- group :plugins do
10
- gem 'vagrant-save', path: '.'
11
- end
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
5
+ end
6
+
7
+ gem 'vagrant-export', '>= 0.3.4', git: 'https://github.com/trenker/vagrant-export.git'
8
+
9
+ group :plugins do
10
+ gem 'vagrant-save', path: '.'
11
+ end
data/README.md CHANGED
@@ -1,73 +1,73 @@
1
- # vagrant-save
2
-
3
- This is a simple plugin to export boxes into .box files using [vagrant-export](https://github.com/trenker/vagrant-export) and pushes that file to a [boxserver](https://github.com/trenker/boxserver) instance.
4
-
5
- ## Installation
6
-
7
- Like with any other vagrant plugin:
8
-
9
- ```bash
10
- vagrant plugin install vagrant-save
11
- ```
12
-
13
- ## Usage
14
-
15
- Have a [boxserver](https://github.com/trenker/boxserver) instance running and set the property `config.vm.box_server_url` to its address in your vagrant file. So your `Vagrantfile` contains the following statements:
16
-
17
- ```ruby
18
- Vagrant.configure("2") do |config|
19
- # This must be set
20
- config.vm.box_server_url = "http://localhost:8001"
21
- end
22
- ```
23
-
24
- Then just run
25
-
26
- ```bash
27
- vagrant save
28
- ```
29
-
30
- to release a new version of your box.
31
-
32
- By default, it increases the bugfix version number by one. So an installed 1.0.0 becomes 1.0.1. You can specify the version yourself using the parameter `-v|--version`, like this:
33
-
34
- ```bash
35
- vagrant save -v 1.2.0
36
- ```
37
-
38
- The parameter must always have all three digits and must be greater than the installed version.
39
-
40
- You may want to clean up the boxserver by deleting old versions. The `-k|--keep` parameter sets how many versions to keep. The versions are sorted in descending order, older than the newest X will be deleted:
41
-
42
- ```bash
43
- # Keeping the last six versions
44
- vagrant save -k 6
45
-
46
- # Keeping all versions
47
- # Does not need to be written, as it is the default setting
48
- vagrant save -k 0
49
- ```
50
-
51
- ## License
52
-
53
- The MIT License (MIT)
54
-
55
- Copyright (c) 2014 Georg Großberger
56
-
57
- Permission is hereby granted, free of charge, to any person obtaining a copy
58
- of this software and associated documentation files (the "Software"), to deal
59
- in the Software without restriction, including without limitation the rights
60
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
61
- copies of the Software, and to permit persons to whom the Software is
62
- furnished to do so, subject to the following conditions:
63
-
64
- The above copyright notice and this permission notice shall be included in
65
- all copies or substantial portions of the Software.
66
-
67
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
68
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
69
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
70
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
71
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
72
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
73
- THE SOFTWARE.
1
+ # vagrant-save
2
+
3
+ This is a simple plugin to export boxes into .box files using [vagrant-export](https://github.com/trenker/vagrant-export) and pushes that file to a [boxserver](https://github.com/trenker/boxserver) instance.
4
+
5
+ ## Installation
6
+
7
+ Like with any other vagrant plugin:
8
+
9
+ ```bash
10
+ vagrant plugin install vagrant-save
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Have a [boxserver](https://github.com/trenker/boxserver) instance running and set the property `config.vm.box_server_url` to its address in your vagrant file. So your `Vagrantfile` contains the following statements:
16
+
17
+ ```ruby
18
+ Vagrant.configure("2") do |config|
19
+ # This must be set
20
+ config.vm.box_server_url = "http://localhost:8001"
21
+ end
22
+ ```
23
+
24
+ Then just run
25
+
26
+ ```bash
27
+ vagrant save
28
+ ```
29
+
30
+ to release a new version of your box.
31
+
32
+ By default, it increases the bugfix version number by one. So an installed 1.0.0 becomes 1.0.1. You can specify the version yourself using the parameter `-v|--version`, like this:
33
+
34
+ ```bash
35
+ vagrant save -v 1.2.0
36
+ ```
37
+
38
+ The parameter must always have all three digits and must be greater than the installed version.
39
+
40
+ You may want to clean up the boxserver by deleting old versions. The `-k|--keep` parameter sets how many versions to keep. The versions are sorted in descending order, older than the newest X will be deleted:
41
+
42
+ ```bash
43
+ # Keeping the last six versions
44
+ vagrant save -k 6
45
+
46
+ # Keeping all versions
47
+ # Does not need to be written, as it is the default setting
48
+ vagrant save -k 0
49
+ ```
50
+
51
+ ## License
52
+
53
+ The MIT License (MIT)
54
+
55
+ Copyright (c) 2014 Georg Großberger
56
+
57
+ Permission is hereby granted, free of charge, to any person obtaining a copy
58
+ of this software and associated documentation files (the "Software"), to deal
59
+ in the Software without restriction, including without limitation the rights
60
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
61
+ copies of the Software, and to permit persons to whom the Software is
62
+ furnished to do so, subject to the following conditions:
63
+
64
+ The above copyright notice and this permission notice shall be included in
65
+ all copies or substantial portions of the Software.
66
+
67
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
68
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
69
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
70
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
71
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
72
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
73
+ THE SOFTWARE.
@@ -45,7 +45,6 @@ module VagrantPlugins
45
45
  require 'vagrant-export/exporter'
46
46
  require_relative 'uploader'
47
47
 
48
- ex = VagrantPlugins::Export::Exporter.new(@env, @logger)
49
48
  up = Uploader.new(@env, @logger)
50
49
 
51
50
  with_target_vms argv, reverse: true do |machine|
@@ -67,9 +66,19 @@ module VagrantPlugins
67
66
  end
68
67
  end
69
68
 
70
- file = ex.handle(machine, false, false)
69
+ ex = VagrantPlugins::Export::Exporter.new(machine, @env, @logger)
70
+ file = ex.target_file
71
+
72
+ unless File.file?(file)
73
+ ex.handle(false, false)
74
+ end
75
+
71
76
  provider_name = up.send(machine, file, version)
72
77
 
78
+ data = @env.machine_index.get(machine.index_uuid)
79
+ data.extra_data['version'] = version
80
+ @env.machine_index.set(data)
81
+
73
82
  @env.boxes.add(
74
83
  file,
75
84
  machine.box.name,
@@ -50,8 +50,29 @@ module VagrantPlugins
50
50
  @logger.debug("Sending file to #{post_url}")
51
51
 
52
52
  File.open(file) do |f|
53
- body = {'box' => f}
54
- res = client.post(post_url, body)
53
+ body = {:box => f}
54
+ connection = client.post_async(post_url, body)
55
+ i = 0
56
+
57
+ while true
58
+ break if connection.finished?
59
+
60
+ @env.ui.info('.', new_line: false)
61
+ i++
62
+
63
+ if i > 40
64
+ @env.ui.clear_line
65
+ i = 0
66
+ end
67
+
68
+ sleep 1
69
+ end
70
+
71
+ if i > 0
72
+ @env.ui.clear_line
73
+ end
74
+
75
+ res = connection.pop
55
76
  end
56
77
 
57
78
  raise VagrantPlugins::Save::Errors::UploadFailed unless res.http_header.status_code == 200
@@ -5,6 +5,6 @@
5
5
 
6
6
  module VagrantPlugins
7
7
  module Save
8
- VERSION = '0.2.6'
8
+ VERSION = '0.2.7'
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-save
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Georg Grossberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-12 00:00:00.000000000 Z
11
+ date: 2015-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vagrant-export
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 2.4.6
63
+ rubygems_version: 2.2.2
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: Export boxes to a boxserver