kontena-plugin-vagrant 0.2.5 → 0.2.6

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: f4b6d05a1acd9caea57171dfffd5575fa4bddb83
4
- data.tar.gz: 8463d41a1765d65d0d483b5be15bb77d562f20ae
3
+ metadata.gz: 08ae2e51eecc84137f3dc9663d6ebd4e88cfe4b8
4
+ data.tar.gz: 111f32338ef7500c77560e2529bc6ffe20b5baa9
5
5
  SHA512:
6
- metadata.gz: fa320c9a13790b611d89e56307828cc98c70a0ccfe6c50350fb48f04bcfc94249efd0028b42f962ab723ba3496844cc16e238af5493ac92eac87d4e62ee940e0
7
- data.tar.gz: ec8015b0acf5a5e3f8af8f4808a616baa8e3eb755dc160d13ed3c11aebfabb70b3fac85b7281aa3baa2cc56ed6a07f65a7b9def5746df0d37a485467e2914c86
6
+ metadata.gz: 684ae2978624bd34b3042f39e877ecf7be51b1637485b2f9d5e07e83749c3aadd1abf377c7b0dc3edaa8681bb4f2ccf954b6dd4ed8e213b624a0df01a6457e3b
7
+ data.tar.gz: 206a3751430018109b1dce5d925666798f3a1184da7aed082340b6cc8cfdd767a40132ed0cf2e1fc5c53a52861e910cb26c135d484b5a92663b33681eb1fa66b
@@ -2,14 +2,22 @@ module Kontena::Plugin::Vagrant::Master
2
2
  class SshCommand < Kontena::Command
3
3
  include Kontena::Cli::Common
4
4
 
5
+ parameter "[COMMANDS] ...", "Run command on Master"
6
+
5
7
  def execute
8
+ require 'shellwords'
6
9
  require_relative '../../../machine/vagrant'
7
10
 
8
11
  vagrant_path = "#{Dir.home}/.kontena/vagrant_master"
9
12
  abort("Cannot find Vagrant kontena-master".colorize(:red)) unless Dir.exist?(vagrant_path)
10
13
 
14
+ cmd = "vagrant ssh"
15
+ if self.commands_list && !self.commands_list.empty?
16
+ cmd << " -c '#{self.commands_list.shelljoin}'"
17
+ end
18
+
11
19
  Dir.chdir(vagrant_path) do
12
- system('vagrant ssh')
20
+ system(cmd)
13
21
  end
14
22
  end
15
23
  end
@@ -4,18 +4,24 @@ module Kontena::Plugin::Vagrant::Nodes
4
4
  include Kontena::Cli::GridOptions
5
5
 
6
6
  parameter "NAME", "Node name"
7
+ parameter "[COMMANDS] ...", "Run command on node"
7
8
 
8
9
  def execute
9
10
  require_api_url
10
11
  require_current_grid
11
12
 
13
+ require 'shellwords'
12
14
  require_relative '../../../machine/vagrant'
13
15
 
14
16
  vagrant_path = "#{Dir.home}/.kontena/#{current_grid}/#{name}"
15
17
  abort("Cannot find Vagrant node #{name}".colorize(:red)) unless Dir.exist?(vagrant_path)
16
18
 
19
+ cmd = "vagrant ssh"
20
+ if self.commands_list && !self.commands_list.empty?
21
+ cmd << " -c '#{self.commands_list.shelljoin}'"
22
+ end
17
23
  Dir.chdir(vagrant_path) do
18
- system('vagrant ssh')
24
+ system(cmd)
19
25
  end
20
26
  end
21
27
  end
@@ -1,7 +1,7 @@
1
1
  module Kontena
2
2
  module Plugin
3
3
  module Vagrant
4
- VERSION = "0.2.5"
4
+ VERSION = "0.2.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-plugin-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kontena-cli