lib/percheron/actions/shell.rb in percheron-0.7.1 vs lib/percheron/actions/shell.rb in percheron-0.7.2

- old
+ new

@@ -2,26 +2,28 @@ module Actions class Shell include Base DEFAULT_SHELL = '/bin/sh' + DOCKER_CLIENT = 'docker' def initialize(container, shell: DEFAULT_SHELL) @container = container @shell = shell end def execute! - $logger.debug "Executing a bash shell on '#{container.name}' container" + Validators::DockerClient.new.validate_docker_client_available! + $logger.debug "Executing #{shell} on '#{container.name}' container" exec! end private attr_reader :container, :shell def exec! - system('docker exec -ti %s %s' % [ container.full_name, shell ]) + system('%s exec -ti %s %s' % [ DOCKER_CLIENT, container.full_name, shell ]) end end end end