Sha256: cad78ae064917f52c5f1f0f2b873f228832940260edc896b4e04c1215e06e9cb

Contents?: true

Size: 793 Bytes

Versions: 8

Compression:

Stored size: 793 Bytes

Contents

# frozen_string_literal: true

# tau ship container clean
module ShipContainerClean
  # Remove all takelship containers
  def ship_container_clean
    _ship_container_clean_remove_containers
  end

  private

  # Remove all takelship containers
  # rubocop:disable Metrics/MethodLength
  def _ship_container_clean_remove_containers
    ship_name = config.active['ship_name']
    log.debug "Getting all #{ship_name} containers"

    cmd_docker_get = format(
      config.active['cmd_docker_container_get_containers'],
      docker: config.active['cmd_docker'],
      docker_repo: ship_name
    )

    containers = (run cmd_docker_get).split(/\n+/)
    containers.each do |container|
      _ship_container_lib_remove_container container
    end
  end
  # rubocop:enable Metrics/MethodLength
end

Version data entries

8 entries across 8 versions & 1 rubygems

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