Sha256: 6cef6d7ed63ec7a015e64d9522aa42b2ae65fb5a1f7a84d2cf2031e6653ad2e7

Contents?: true

Size: 1.31 KB

Versions: 16

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

# takelage docker container login
module DockerContainerLogin
  # Backend method for docker container login.
  def docker_container_login
    log.debug 'Logging in to docker container'

    return false unless docker_check_running

    _docker_container_login_check_outdated
    docker_socket_start
    return false unless _docker_container_lib_create_net_and_ctr @hostname

    run_and_exit _docker_container_login_enter_container @hostname
  end

  private

  # Check if newer docker container is available.
  def _docker_container_login_check_outdated
    return if @docker_tag == 'latest'

    outdated = docker_image_check_outdated @docker_tag
    return unless outdated

    tag_latest = docker_image_tag_latest_remote
    log.warn "#{@docker_user}/#{@docker_repo}:#{@docker_tag} is outdated"
    log.warn "#{@docker_user}/#{@docker_repo}:#{tag_latest} is available"
  end

  # Prepare enter existing container command.
  def _docker_container_login_enter_container(container)
    log.debug "Entering container \"#{container}\""

    loginpoint = '/loginpoint.py'
    loginpoint = '/debug/loginpoint.py --debug ' if options[:debug]

    format(
      config.active['cmd_docker_container_enter_container'],
      container: container,
      loginpoint: loginpoint,
      username: @username
    )
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
takelage-0.22.2 lib/takelage/docker/container/login.rb
takelage-0.22.1 lib/takelage/docker/container/login.rb
takelage-0.22.0 lib/takelage/docker/container/login.rb
takelage-0.21.1 lib/takelage/docker/container/login.rb
takelage-0.21.0 lib/takelage/docker/container/login.rb
takelage-0.20.2 lib/takelage/docker/container/login.rb
takelage-0.20.1 lib/takelage/docker/container/login.rb
takelage-0.20.0 lib/takelage/docker/container/login.rb
takelage-0.19.2 lib/takelage/docker/container/login.rb
takelage-0.19.1 lib/takelage/docker/container/login.rb
takelage-0.19.0 lib/takelage/docker/container/login.rb
takelage-0.18.1 lib/takelage/docker/container/login.rb
takelage-0.18.0 lib/takelage/docker/container/login.rb
takelage-0.17.1 lib/takelage/docker/container/login.rb
takelage-0.17.0 lib/takelage/docker/container/login.rb
takelage-0.16.0 lib/takelage/docker/container/login.rb