Sha256: 8a725c38265e8a876fd13ddabdeafa7ebaa172aa838bfd4ff21c0ddb24c327ab

Contents?: true

Size: 943 Bytes

Versions: 48

Compression:

Stored size: 943 Bytes

Contents

# frozen_string_literal: true

# tau ship container check existing
module ShipContainerCheckExisting
  # Backend method for ship container check existing.
  # @return [Boolean] is container existing?
  def ship_container_check_existing
    ship_hostname = _ship_container_lib_ship_hostname
    log.debug "Checking if takelship \"#{ship_hostname}\" is existing"

    stdout_str = run _ship_container_cmd_check_existing ship_hostname

    if stdout_str.to_s.chomp.empty?
      log.debug "The takelship \"#{ship_hostname}\" is not existing"
      return false
    end

    log.debug "The takelship \"#{ship_hostname}\" is existing"
    true
  end

  private

  # Format command to check if ship container exists.
  def _ship_container_cmd_check_existing(ship_hostname)
    format(
      config.active['cmd_docker_container_check_existing_docker_ps'],
      docker: config.active['cmd_ship_docker'],
      container: ship_hostname
    )
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
takeltau-0.44.14 lib/takeltau/ship/container/check/existing.rb
takeltau-0.44.12 lib/takeltau/ship/container/check/existing.rb
takeltau-0.44.11 lib/takeltau/ship/container/check/existing.rb
takeltau-0.44.8 lib/takeltau/ship/container/check/existing.rb
takeltau-0.44.2 lib/takeltau/ship/container/check/existing.rb
takeltau-0.43.23 lib/takeltau/ship/container/check/existing.rb
takeltau-0.43.21 lib/takeltau/ship/container/check/existing.rb
takeltau-0.43.19 lib/takeltau/ship/container/check/existing.rb