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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96d882efc34e6bd024456bc684859a11a75e3e8aac0a644ef12b99d0b9ee3fd9
4
- data.tar.gz: 85a954591bca1afd04d851004491cfa687a84f3155b32b1b3bd315ed023e2d7c
3
+ metadata.gz: 6e55bcdcc4ce55236626c698fbd3cf09d0891494c059623ecf8586c5307cf9e5
4
+ data.tar.gz: 7fe315f91f8e1e539c0364e1190885bf6a74bb31808362c8448dd8c26920e556
5
5
  SHA512:
6
- metadata.gz: bd47ecd14c1a764678fc9c00d73dcb716159e9b9c5fb0da73418d6fbb4427bc4e1ced1119e3efd8519547b739a20aa1641dce1f28031a70f8cc112e7f768b5e4
7
- data.tar.gz: 60d41cb0846f94ed1d1463b08c66384805e9467a3a5f83fd724ec22dd8c9b16ba05cc7d637730ee8b50f6d658ff1d1511ac5b8e1742db96eb00f26056bda9c1a
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).
@@ -9,6 +9,8 @@ Vagrant.configure("2") do |config|
9
9
 
10
10
  config.vm.provider :vmck do |provider|
11
11
  provider.vmck_url = 'http://127.0.0.1:8000'
12
+ provider.memory = 1024
13
+ provider.cpus = 2
12
14
  end
13
15
 
14
16
  end
@@ -15,7 +15,11 @@ module VagrantPlugins
15
15
  client = env[:vmck]
16
16
 
17
17
  env[:ui].info("Vmck starting job ...")
18
- id = client.create()['id'].to_s
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 ...")
@@ -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)
@@ -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
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Vmck
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
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.3
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-06 00:00:00.000000000 Z
11
+ date: 2019-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday