Sha256: 2c3e03ea41ba584966ce394d2409e15a17e5ea3df8cc46f35fef929e8a1ce484

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

# tau docker container command
module DockerContainerCommand
  # Backend method for docker container command.
  def docker_container_command(command)
    log.debug 'Running command in container'

    return false unless docker_check_daemon

    # no matrjoschka test here

    unless docker_container_check_existing @hostname
      return false unless _docker_container_lib_create_net_and_ctr @hostname

      _docker_container_lib_start_sockets
    end

    _docker_container_command_run_command @hostname, command
  end

  private

  # Prepare run command in container command.
  def _docker_container_command_run_command(container, command)
    log.debug "Running command \"#{command}\" in container \"#{container}\""

    cmd_docker_run_command =
      format(
        config.active['cmd_docker_container_docker_exec'],
        docker: config.active['cmd_docker'],
        container: container,
        username: @username,
        command: command
      )

    run_and_exit cmd_docker_run_command
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
takeltau-0.43.16 lib/takeltau/docker/container/command.rb
takeltau-0.43.15 lib/takeltau/docker/container/command.rb
takeltau-0.43.14 lib/takeltau/docker/container/command.rb
takeltau-0.43.10 lib/takeltau/docker/container/command.rb