vagrant-vmck 0.2.1 → 0.3.0

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
- SHA1:
3
- metadata.gz: 702e962985deff117d960b6ab57a2a4ac0050902
4
- data.tar.gz: a23724d365f4d744a291762a6a9a51effb070b36
2
+ SHA256:
3
+ metadata.gz: 149034e449df45700dff46c992c1a527f2e07fb03a7107b93fc884309cd97de0
4
+ data.tar.gz: 1f43c2f7db3e9b6da7d317ea48945851b67d9b587d16d1a9f83996be5e714283
5
5
  SHA512:
6
- metadata.gz: 0eab0cbd1c8dda52425372fac1ed3ea63609ca515592a33b630dba634afbba2d3d16f5855120b389ac3ba5d29276c3d58b57310d7c084f3c87d45da638d0b057
7
- data.tar.gz: 4e6df24ec7a661e36e3475e973b438365f18fc437114b00a672a4749c81743616588fac97e0937262ae62bcd18119ecf5139da4f2d01755894be7150906b2425
6
+ metadata.gz: 1f6499622e5dd56fb30be7c36695061a608d0fb5203f880e404c9a01bd5f05da7b63e08d751b153252de788343dc862e846493cd696e0142783e64a68ad0b446
7
+ data.tar.gz: 8905eefe833046c7a4e4819032d3dabfcbcb704489afae8e0375c10bf1ea04d93397308e1caf3695de23cd37551fefdd1b967dddbe5456030d51ea6ce5d4791b
@@ -0,0 +1,29 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ jobs:
9
+ build:
10
+ name: Build + Publish
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@master
15
+ - name: Set up Ruby 2.6
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ version: 2.6.x
19
+
20
+ - name: Publish to RubyGems
21
+ run: |
22
+ mkdir -p $HOME/.gem
23
+ touch $HOME/.gem/credentials
24
+ chmod 0600 $HOME/.gem/credentials
25
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
26
+ gem build *.gemspec
27
+ gem push *.gem
28
+ env:
29
+ GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
data/.gitignore CHANGED
@@ -1,5 +1,3 @@
1
1
  /.bundle/
2
2
  /Gemfile.lock
3
3
  .vagrant
4
- Vagrantfile
5
- !example_box/Vagrantfile
data/Dockerfile CHANGED
@@ -7,7 +7,7 @@ ADD . .
7
7
 
8
8
  RUN set -e \
9
9
  && apt-get update -q \
10
- && apt-get install -yq wget git procps kmod rsync ruby-dev \
10
+ && apt-get install -yq wget git procps kmod rsync ruby-dev curl jq\
11
11
  && wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.deb \
12
12
  && dpkg -i vagrant_2.2.4_x86_64.deb \
13
13
  && rm vagrant_2.2.4_x86_64.deb \
@@ -0,0 +1 @@
1
+ /.env
@@ -2,10 +2,18 @@
2
2
  # vi: set ft=ruby :
3
3
 
4
4
  Vagrant.configure("2") do |config|
5
+ if Vagrant.has_plugin?("vagrant-env")
6
+ config.env.enable
7
+ end
5
8
 
6
9
  config.vm.box = "base"
10
+ config.nfs.functional = false
11
+ config.smb.functional = false
7
12
 
8
- config.vm.provision 'hello', type: 'shell', inline: 'echo hello world'
13
+ config.vm.provision 'hello', type: 'shell', inline: "
14
+ set -x
15
+ echo hello world
16
+ "
9
17
 
10
18
  config.vm.provider :vmck do |vmck|
11
19
  vmck.image_path = 'imgbuild-master.qcow2.tar.gz'
@@ -13,7 +21,7 @@ Vagrant.configure("2") do |config|
13
21
  vmck.memory = 512
14
22
  vmck.cpus = 1
15
23
  vmck.storage = ENV['VMCK_STORAGE']
16
- vmck.name = ENV['JOB_NAME']
24
+ vmck.name = ENV['VMCK_NAME']
17
25
  end
18
26
 
19
27
  end
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ set -ex
3
+ vagrant plugin install vagrant-vmck vagrant-env
@@ -14,15 +14,21 @@ module VagrantPlugins
14
14
  def call(env)
15
15
  client = env[:vmck]
16
16
 
17
- env[:ui].info("Vmck starting job ...")
18
- options = {
19
- 'cpus': env[:machine].provider_config.cpus,
20
- 'memory': env[:machine].provider_config.memory,
21
- 'image_path': env[:machine].provider_config.image_path,
22
- 'storage': env[:machine].provider_config.storage,
23
- 'name': env[:machine].provider_config.name,
24
- }
25
- id = client.create(options)['id'].to_s
17
+ if ENV['VMCK_JOB_ID'].nil?
18
+ env[:ui].info("Vmck starting job ...")
19
+ options = {
20
+ 'cpus': env[:machine].provider_config.cpus,
21
+ 'memory': env[:machine].provider_config.memory,
22
+ 'image_path': env[:machine].provider_config.image_path,
23
+ 'storage': env[:machine].provider_config.storage,
24
+ 'name': env[:machine].provider_config.name,
25
+ }
26
+ id = client.create(options)['id'].to_s
27
+ else
28
+ id = ENV['VMCK_JOB_ID']
29
+ env[:ui].info("Vmck using existing job #{id}")
30
+ end
31
+
26
32
  env[:machine].id = id
27
33
 
28
34
  env[:ui].info("Vmck waiting for job #{id} to be ready ...")
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Vmck
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -0,0 +1,15 @@
1
+ Vagrant.configure("2") do |config|
2
+ config.vm.box = 'base'
3
+
4
+ if Vagrant.has_plugin?('vagrant-env')
5
+ config.env.enable
6
+ end
7
+
8
+ config.nfs.functional = false
9
+ config.vm.provision 'shell', inline: 'mv /vagrant/submission.zip .; \
10
+ unzip submission.zip; \
11
+ chown -R vagrant:vagrant .'
12
+ config.vm.provider :vmck do |vmck|
13
+ vmck.vmck_url = ENV['VMCK_URL']
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ #!/bin/bash -ex
2
+
3
+ cd "$( dirname "${BASH_SOURCE[0]}" )"
4
+
5
+ trap "vagrant destroy -f" EXIT
6
+
7
+ curl "${ARCHIVE_URL}" -o submission.zip
8
+ curl "${SCRIPT_URL}" -o checker.sh
9
+
10
+ vagrant up
11
+ vagrant ssh -- < checker.sh > result.out
12
+
13
+ data="$(base64 result.out)"
14
+ JSON_STRING=$(jq -n \
15
+ --arg tok "$SUBMISSION_ID" \
16
+ --arg out "$data" \
17
+ '{token: $tok, output: $out,}')
18
+ curl -X POST "${INTERFACE_ADDRESS}/done/" -d "$JSON_STRING" \
19
+ --header "Content-Type: application/json"
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.2.1
4
+ version: 0.3.0
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-09-03 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -88,13 +88,16 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".drone.yml"
91
+ - ".github/workflows/gempush.yml"
91
92
  - ".gitignore"
92
93
  - Dockerfile
93
94
  - Gemfile
94
95
  - LICENSE.txt
95
96
  - Readme.md
97
+ - examples/box/.gitignore
96
98
  - examples/box/Vagrantfile
97
99
  - examples/docker.sh
100
+ - examples/install.sh
98
101
  - lib/vagrant-vmck.rb
99
102
  - lib/vagrant-vmck/action.rb
100
103
  - lib/vagrant-vmck/action/connect_vmck.rb
@@ -107,6 +110,8 @@ files:
107
110
  - lib/vagrant-vmck/provider.rb
108
111
  - lib/vagrant-vmck/version.rb
109
112
  - run-test.sh
113
+ - submission/Vagrantfile
114
+ - submission/launch.sh
110
115
  - vagrant-vmck.gemspec
111
116
  homepage: https://github.com/mgax/vagrant-vmck
112
117
  licenses:
@@ -127,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
132
  - !ruby/object:Gem::Version
128
133
  version: '0'
129
134
  requirements: []
130
- rubyforge_project:
131
- rubygems_version: 2.5.2.3
135
+ rubygems_version: 3.0.3
132
136
  signing_key:
133
137
  specification_version: 4
134
138
  summary: Vagrant provider plugin for Vmck.