Sha256: 012c9219ed59109035e1a83f039af6724983b330e158b7c4f520599b4190f974

Contents?: true

Size: 920 Bytes

Versions: 97

Compression:

Stored size: 920 Bytes

Contents

module CC
  module CLI
    module Engines
      class Install < EngineCommand
        SHORT_HELP = "Pull the latest images for enabled engines in your configuration".freeze

        ImagePullFailure = Class.new(StandardError)

        def run
          say "Pulling docker images."
          pull_docker_images
        end

        private

        def config
          @config ||= CC::Config.load
        end

        def pull_docker_images
          config.engines.each(&method(:pull_engine))
        end

        def pull_engine(engine)
          metadata = engine_registry.fetch_engine_details(engine)
          unless system("docker pull #{metadata.image}")
            raise ImagePullFailure, "unable to pull image #{metadata.image}"
          end
        rescue EngineRegistry::EngineDetailsNotFoundError
          warn("unknown engine <#{engine.name}:#{engine.channel}>")
        end
      end
    end
  end
end

Version data entries

97 entries across 97 versions & 2 rubygems

Version Path
codeclimate-0.85.27 lib/cc/cli/engines/install.rb
codeclimate-0.85.26 lib/cc/cli/engines/install.rb
codeclimate-0.85.25 lib/cc/cli/engines/install.rb
codeclimate-0.85.24 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.54 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.53 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.52 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.51 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.50 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.49 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.48 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.47 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.46 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.45 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.44 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.43 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.42 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.41 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.40 lib/cc/cli/engines/install.rb
codeclimate-fede-0.85.39 lib/cc/cli/engines/install.rb