Class: Kitchen::Driver::SSHBaseGzip
- Inherits:
-
Base
- Object
- Base
- Kitchen::Driver::SSHBaseGzip
- Defined in:
- lib/kitchen/driver/ssh_base_gzip.rb
Overview
Base class for a driver that uses SSH to communication with an instance. A subclass must implement the following methods:
-
#create(state)
-
#destroy(state)
Direct Known Subclasses
Instance Method Summary collapse
- #converge(state) ⇒ Object
- #create(state) ⇒ Object
- #destroy(state) ⇒ Object
- #login_command(state) ⇒ Object
-
#remote_command(state, command) ⇒ Object
Executes an arbitrary command on an instance over an SSH connection.
- #setup(state) ⇒ Object
-
#ssh(ssh_args, command) ⇒ Object
deprecated
Deprecated.
This method should no longer be called directly and exists to support very old drivers. This will be removed in the future.
- #verify(state) ⇒ Object
Instance Method Details
#converge(state) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 43 def converge(state) provisioner = instance.provisioner provisioner.create_sandbox Kitchen::SSH.new(*build_ssh_args(state)) do |conn| run_remote(provisioner.install_command, conn) run_remote(provisioner.init_command, conn) do_sandbox_transfer provisioner, conn run_remote(provisioner.prepare_command, conn) run_remote(provisioner.run_command, conn) end ensure provisioner && provisioner.cleanup_sandbox end |
#create(state) ⇒ Object
38 39 40 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 38 def create(state) # rubocop:disable Lint/UnusedMethodArgument raise ClientError, "#{self.class}#create must be implemented" end |
#destroy(state) ⇒ Object
74 75 76 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 74 def destroy(state) # rubocop:disable Lint/UnusedMethodArgument raise ClientError, "#{self.class}#destroy must be implemented" end |
#login_command(state) ⇒ Object
79 80 81 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 79 def login_command(state) SSH.new(*build_ssh_args(state)).login_command end |
#remote_command(state, command) ⇒ Object
Executes an arbitrary command on an instance over an SSH connection.
88 89 90 91 92 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 88 def remote_command(state, command) Kitchen::SSH.new(*build_ssh_args(state)) do |conn| run_remote(command, conn) end end |
#setup(state) ⇒ Object
59 60 61 62 63 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 59 def setup(state) Kitchen::SSH.new(*build_ssh_args(state)) do |conn| run_remote(busser.setup_cmd, conn) end end |
#ssh(ssh_args, command) ⇒ Object
Deprecated.
This method should no longer be called directly and exists to support very old drivers. This will be removed in the future.
**(Deprecated)** Executes a remote command over SSH.
100 101 102 103 104 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 100 def ssh(ssh_args, command) Kitchen::SSH.new(*ssh_args) do |conn| run_remote(command, conn) end end |
#verify(state) ⇒ Object
66 67 68 69 70 71 |
# File 'lib/kitchen/driver/ssh_base_gzip.rb', line 66 def verify(state) Kitchen::SSH.new(*build_ssh_args(state)) do |conn| run_remote(busser.sync_cmd, conn) run_remote(busser.run_cmd, conn) end end |