vagrant-vmck 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +8 -0
- data/example_box/Vagrantfile +2 -0
- data/lib/vagrant-vmck/action/create.rb +5 -1
- data/lib/vagrant-vmck/client.rb +7 -3
- data/lib/vagrant-vmck/config.rb +6 -0
- data/lib/vagrant-vmck/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e55bcdcc4ce55236626c698fbd3cf09d0891494c059623ecf8586c5307cf9e5
|
4
|
+
data.tar.gz: 7fe315f91f8e1e539c0364e1190885bf6a74bb31808362c8448dd8c26920e556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f13a49c9205d4dd6cdda05c90a36a0115221ae423f7f14b927ca06feb5a1a784514eaec07e0c456433c7d97d7fcc737a0eabb521ab66a1efdb07cb7c282c2cb4
|
7
|
+
data.tar.gz: cca2f57596bc981aa8e3ea9768c9f99b1f4d3194ff4653bb00791169f214cfc5a0c46532da0bc61708d54096abda123e762b51504f181d9be58b7e284df83982
|
data/Readme.md
CHANGED
@@ -22,6 +22,14 @@ See `example_box/Vagrantfile` for an example configuration.
|
|
22
22
|
$ vagrant up --provider=vmck
|
23
23
|
```
|
24
24
|
|
25
|
+
## Release
|
26
|
+
1. Update `lib/vagrant-vmck/version.rb` and commit
|
27
|
+
2. `git tag v1.2.3; git push --tags`
|
28
|
+
3. `gem release`
|
29
|
+
4. `docker build . --tag vmck/vagrant-vmck:1.2.3 --no-cache`
|
30
|
+
5. `docker build . --tag vmck/vagrant-vmck` (should reuse the previous build)
|
31
|
+
6. `docker push vmck/vagrant-vmck`
|
32
|
+
|
25
33
|
## License
|
26
34
|
|
27
35
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/example_box/Vagrantfile
CHANGED
@@ -15,7 +15,11 @@ module VagrantPlugins
|
|
15
15
|
client = env[:vmck]
|
16
16
|
|
17
17
|
env[:ui].info("Vmck starting job ...")
|
18
|
-
|
18
|
+
options = {
|
19
|
+
'cpus': env[:machine].provider_config.cpus,
|
20
|
+
'memory': env[:machine].provider_config.memory,
|
21
|
+
}
|
22
|
+
id = client.create(options)['id'].to_s
|
19
23
|
env[:machine].id = id
|
20
24
|
|
21
25
|
env[:ui].info("Vmck waiting for job #{id} to be ready ...")
|
data/lib/vagrant-vmck/client.rb
CHANGED
@@ -10,11 +10,15 @@ module VagrantPlugins
|
|
10
10
|
@client = Faraday.new({ :url => url })
|
11
11
|
end
|
12
12
|
|
13
|
-
def request(method, path)
|
13
|
+
def request(method, path, data=nil)
|
14
14
|
@logger.info "Request: #{path}"
|
15
15
|
|
16
16
|
result = @client.send(method) do |req|
|
17
17
|
req.url(path)
|
18
|
+
if data
|
19
|
+
req.headers['Content-Type'] = 'application/json'
|
20
|
+
req.body = JSON.generate(data)
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
if method == :delete
|
@@ -35,8 +39,8 @@ module VagrantPlugins
|
|
35
39
|
|
36
40
|
end
|
37
41
|
|
38
|
-
def create
|
39
|
-
request(:post, "/v0/jobs")
|
42
|
+
def create(options)
|
43
|
+
request(:post, "/v0/jobs", options)
|
40
44
|
end
|
41
45
|
|
42
46
|
def get(id)
|
data/lib/vagrant-vmck/config.rb
CHANGED
@@ -3,15 +3,21 @@ module VagrantPlugins
|
|
3
3
|
class Config < Vagrant.plugin('2', :config)
|
4
4
|
attr_accessor :vmck_url
|
5
5
|
attr_accessor :private_key_path
|
6
|
+
attr_accessor :memory
|
7
|
+
attr_accessor :cpus
|
6
8
|
|
7
9
|
def initialize
|
8
10
|
@vmck_url = UNSET_VALUE
|
9
11
|
@private_key_path = UNSET_VALUE
|
12
|
+
@memory = UNSET_VALUE
|
13
|
+
@cpus = UNSET_VALUE
|
10
14
|
end
|
11
15
|
|
12
16
|
def finalize!
|
13
17
|
@vmck_url = nil if @vmck_url == UNSET_VALUE
|
14
18
|
@private_key_path = nil if @private_key_path == UNSET_VALUE
|
19
|
+
@memory = 512 if @memory == UNSET_VALUE
|
20
|
+
@cpus = 1 if @cpus == UNSET_VALUE
|
15
21
|
end
|
16
22
|
|
17
23
|
end
|
data/lib/vagrant-vmck/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vmck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Morega
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|