Sha256: 1a2bdcbeb3becf1f6e984a70a32fded46e4b321502e68046465bf8674aaa2d2f

Contents?: true

Size: 951 Bytes

Versions: 29

Compression:

Stored size: 951 Bytes

Contents

module CC
  module CLI
    module Engines
      class Install < EngineCommand
        ImagePullFailure = Class.new(StandardError)

        def run
          require_codeclimate_yml

          say "Pulling docker images."
          pull_docker_images
        end

        private

        def pull_docker_images
          engine_names.each do |name|
            if engine_registry.exists?(name)
              images = engine_registry[name]["channels"].values
              images.each { |image| pull_engine_image(image) }
            else
              warn("unknown engine name: #{name}")
            end
          end
        end

        def engine_names
          @engine_names ||= parsed_yaml.engine_names
        end

        def pull_engine_image(engine_image)
          unless system("docker pull #{engine_image}")
            raise ImagePullFailure, "unable to pull image #{engine_image}"
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
codeclimate-0.45.0 lib/cc/cli/engines/install.rb
codeclimate-0.44.0 lib/cc/cli/engines/install.rb
codeclimate-0.43.1 lib/cc/cli/engines/install.rb
codeclimate-0.43.0 lib/cc/cli/engines/install.rb
codeclimate-0.42.1 lib/cc/cli/engines/install.rb
codeclimate-0.42.0 lib/cc/cli/engines/install.rb
codeclimate-0.41.0 lib/cc/cli/engines/install.rb
codeclimate-0.40.3 lib/cc/cli/engines/install.rb
codeclimate-0.40.2 lib/cc/cli/engines/install.rb
codeclimate-0.40.1 lib/cc/cli/engines/install.rb
codeclimate-0.40.0 lib/cc/cli/engines/install.rb
codeclimate-0.39.0 lib/cc/cli/engines/install.rb
codeclimate-0.38.1 lib/cc/cli/engines/install.rb
codeclimate-0.38.0 lib/cc/cli/engines/install.rb
codeclimate-0.37.0 lib/cc/cli/engines/install.rb
codeclimate-0.36.0 lib/cc/cli/engines/install.rb
codeclimate-0.35.2 lib/cc/cli/engines/install.rb
codeclimate-0.35.1 lib/cc/cli/engines/install.rb
codeclimate-0.35.0 lib/cc/cli/engines/install.rb
codeclimate-0.34.1 lib/cc/cli/engines/install.rb