Sha256: 45fb8d67af376cd2a444741014862308ef8b255f774dea83c9473fd42abc6001

Contents?: true

Size: 1.13 KB

Versions: 39

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

# tau mutagen socket docker
module MutagenSocketDocker
  # Backend method for mutagen socket docker.
  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

  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

39 entries across 39 versions & 1 rubygems

Version Path
takeltau-0.45.8 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.45.6 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.45.5 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.45.4 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.45.3 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.45.2 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.45.0 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.42 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.41 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.39 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.37 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.36 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.35 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.29 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.27 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.24 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.23 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.19 lib/takeltau/mutagen/socket/docker.rb
takeltau-0.44.18 lib/takeltau/mutagen/socket/docker.rb