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.34.0 lib/cc/cli/engines/install.rb
codeclimate-0.33.0 lib/cc/cli/engines/install.rb
codeclimate-0.32.1 lib/cc/cli/engines/install.rb
codeclimate-0.32.0 lib/cc/cli/engines/install.rb
codeclimate-0.32.0.rc1 lib/cc/cli/engines/install.rb
codeclimate-0.31.1 lib/cc/cli/engines/install.rb
codeclimate-0.31.0 lib/cc/cli/engines/install.rb
codeclimate-0.30.1 lib/cc/cli/engines/install.rb
codeclimate-0.30.0 lib/cc/cli/engines/install.rb