class Kitchen::Transport::Dockercli::Connection

Public Instance Methods

download(remotes, local) click to toggle source
# File lib/kitchen/transport/dockercli.rb, line 45
def download(remotes, local)
  raise "Download not supported."
end
execute(command) click to toggle source
# File lib/kitchen/transport/dockercli.rb, line 24
def execute(command)
  return if command.nil?
  debug command
  tempfile = File.join(ENV['TEMP'], "#{SecureRandom.hex(4)}.ps1")
  begin
    File.open((tempfile), 'w') { |file| file.write(command) }
    dockered_command = "docker exec #{options[:container_id]} powershell.exe -noprofile -executionpolicy unrestricted -file #{tempfile}"
    run_command(dockered_command)
  ensure
    File.unlink(tempfile)
  end
end
login_command() click to toggle source
# File lib/kitchen/transport/dockercli.rb, line 49
def login_command
  LoginCommand.new("docker exec -it #{options[:container_id]} powershell.exe -noprofile -executionpolicy unresticted", nil)
end
upload(locals, remote) click to toggle source
# File lib/kitchen/transport/dockercli.rb, line 37
def upload(locals, remote)
  powershell_commands = Array.new 
  Array(locals).each do |local|
    powershell_commands << "copy-item #{local} #{remote} -force -recurse;"
  end
  execute(powershell_commands.join)
end