Sha256: dc8457c9cb40de81435d827085088db8f8041a0a4311daded755426a03bc288a

Contents?: true

Size: 635 Bytes

Versions: 5

Compression:

Stored size: 635 Bytes

Contents

module Kontena::Plugin::Vagrant::Master
  class StopCommand < Kontena::Command
    include Kontena::Cli::Common

    def execute
      require_relative '../../../machine/vagrant'
      
      vagrant_path = "#{Dir.home}/.kontena/vagrant_master"
      abort("Cannot find Vagrant kontena-master".colorize(:red)) unless Dir.exist?(vagrant_path)
      Dir.chdir(vagrant_path) do
        spinner "Stopping Vagrant kontena-master " do
          Open3.popen2('vagrant halt') do |stdin, output, wait|
            while o = output.gets
              print o if ENV['DEBUG']
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kontena-plugin-vagrant-0.2.7 lib/kontena/plugin/vagrant/master/stop_command.rb
kontena-plugin-vagrant-0.2.6 lib/kontena/plugin/vagrant/master/stop_command.rb
kontena-plugin-vagrant-0.2.5 lib/kontena/plugin/vagrant/master/stop_command.rb
kontena-plugin-vagrant-0.2.2 lib/kontena/plugin/vagrant/master/stop_command.rb
kontena-plugin-vagrant-0.2.1 lib/kontena/plugin/vagrant/master/stop_command.rb