Sha256: 9986cecf37dfb7bcee5fa4bba542761e3040b7db259c33760bb1d01fc2793b7e

Contents?: true

Size: 1.2 KB

Versions: 26

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

# tau mutagen socket docker
module MutagenSocketDocker
  # Backend method for mutagen socket docker.
  # rubocop:disable Metrics/MethodLength
  def mutagen_socket_docker(hostsock)
    # See DockerContainerLib::_docker_container_lib_hostname
    socketname = "#{@hostname[-11..]}-docker"
    log.debug "Create the mutagen docker socket \"#{socketname}\" in the container " \
      "pointing to the host at \"#{hostsock}\""

    return false if mutagen_socket_check socketname

    socket_created = _mutagen_socket_docker_socket(socketname, hostsock)

    unless socket_created.include? 'Created session'
      log.debug "Unable to create mutagen docker socket \"#{socketname}\""
      return false
    end

    log.debug "Created the mutagen docker socket \"#{socketname}\""
    true
  end
  # rubocop:enable Metrics/MethodLength

  private

  # Get git branch.
  def _mutagen_socket_docker_socket(socketname, hostsock)
    cmd_create_socket = format(
      config.active['cmd_mutagen_forward_socket_docker'],
      socketname: socketname,
      hostsock: hostsock,
      container: @hostname,
      hostlabel: @hostlabel,
      takellabel: @takellabel
    )
    run cmd_create_socket
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
takeltau-0.44.14 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.12 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.11 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.8 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.2 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.23 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.21 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.19 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.16 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.15 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.14 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.10 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.6 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.4 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.2 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.43.1 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.42.7 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.42.5 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.42.4 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.42.3 lib/takeltau/mutagen/socket/docker.rb