Sha256: 40c06b83d270c68e13f33a7a0624984b8c352fbc3a6b81cd1a070a81839627a0

Contents?: true

Size: 652 Bytes

Versions: 8

Compression:

Stored size: 652 Bytes

Contents

module Kontena::Plugin::Vagrant::Nodes
  class StartCommand < 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
        spinner "Triggering 'vagrant up' for #{name.colorize(:cyan)}"
        exit $?.exitstatus unless system('vagrant up')
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
krates-plugin-vagrant-0.3.6 lib/kontena/plugin/vagrant/nodes/start_command.rb
krates-plugin-vagrant-0.3.5 lib/kontena/plugin/vagrant/nodes/start_command.rb
krates-plugin-vagrant-0.3.4 lib/kontena/plugin/vagrant/nodes/start_command.rb
krates-plugin-vagrant-0.3.3 lib/kontena/plugin/vagrant/nodes/start_command.rb
krates-plugin-vagrant-0.3.2 lib/kontena/plugin/vagrant/nodes/start_command.rb
krates-plugin-vagrant-0.3.1 lib/kontena/plugin/vagrant/nodes/start_command.rb
kontena-plugin-vagrant-0.3.1 lib/kontena/plugin/vagrant/nodes/start_command.rb
kontena-plugin-vagrant-0.3.0 lib/kontena/plugin/vagrant/nodes/start_command.rb