Sha256: 6b120e448a3cab1c449c02bbe5707ca6e12f879804e67e5bf88ab76383d77759

Contents?: true

Size: 967 Bytes

Versions: 40

Compression:

Stored size: 967 Bytes

Contents

# frozen_string_literal: true

# tau docker image tag check
module DockerImageTagCheck
  # Backend method for docker image tag check.
  # @return [Boolean] does docker image tag exist?
  def docker_image_tag_check(tag)
    log.debug "Check if docker image tag \"#{tag}\" exists"

    if tag.to_s.chomp.empty?
      log.warn 'No docker image tag specified'
      return false
    end

    image = "#{@docker_user}/#{@docker_repo}:#{tag}"

    return false unless _docker_image_check_image? image

    log.debug "Found docker image \"#{image}\""
    true
  end

  private

  # Check if image exists.
  def _docker_image_check_image?(image)
    cmd_docker_images =
      format(
        config.active['cmd_docker_image_tag_check_docker_images'],
        docker: config.active['cmd_docker'],
        image: image
      )

    if (run cmd_docker_images).to_s.chomp.empty?
      log.debug "No docker image \"#{image}\" found"
      return false
    end

    true
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
takeltau-0.46.9 lib/takeltau/docker/image/tag/check.rb
takeltau-0.46.8 lib/takeltau/docker/image/tag/check.rb
takeltau-0.46.5 lib/takeltau/docker/image/tag/check.rb
takeltau-0.46.1 lib/takeltau/docker/image/tag/check.rb
takeltau-0.46.0 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.27 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.26 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.24 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.23 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.22 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.21 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.19 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.17 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.16 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.14 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.13 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.12 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.11 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.10 lib/takeltau/docker/image/tag/check.rb
takeltau-0.45.9 lib/takeltau/docker/image/tag/check.rb