Sha256: 3ef5e967cde20a6e88e67a15911b153c244117dcf9f2490c776a3e13133b3071

Contents?: true

Size: 556 Bytes

Versions: 8

Compression:

Stored size: 556 Bytes

Contents

module Kontena::Plugin::Vagrant::Nodes
  class SshCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "NAME", "Node name"

    def execute
      require_api_url
      require_current_grid

      require_relative '../../../machine/vagrant'

      vagrant_path = "#{Dir.home}/.kontena/#{current_grid}/#{name}"
      abort("Cannot find Vagrant node #{name}".colorize(:red)) unless Dir.exist?(vagrant_path)

      Dir.chdir(vagrant_path) do
        system('vagrant ssh')
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kontena-plugin-vagrant-0.2.5 lib/kontena/plugin/vagrant/nodes/ssh_command.rb
kontena-plugin-vagrant-0.2.2 lib/kontena/plugin/vagrant/nodes/ssh_command.rb
kontena-plugin-vagrant-0.2.1 lib/kontena/plugin/vagrant/nodes/ssh_command.rb
kontena-plugin-vagrant-0.2.0 lib/kontena/plugin/vagrant/nodes/ssh_command.rb
kontena-plugin-vagrant-0.2.0.pre2 lib/kontena/plugin/vagrant/nodes/ssh_command.rb
kontena-plugin-vagrant-0.1.2 lib/kontena/plugin/vagrant/nodes/ssh_command.rb
kontena-plugin-vagrant-0.1.1 lib/kontena/plugin/vagrant/nodes/ssh_command.rb
kontena-plugin-vagrant-0.1.0 lib/kontena/plugin/vagrant/nodes/ssh_command.rb