Sha256: 41682d39a058779417fb69a95fba2149deeb09bf66ad93e204f7c39c4fdf91cf

Contents?: true

Size: 753 Bytes

Versions: 3

Compression:

Stored size: 753 Bytes

Contents

require 'r10k/cli'
require 'r10k/synchro/git'
require 'cri'
require 'r10k/logging'

module R10K::CLI
  module Cache
    def self.command
      @cmd ||= Cri::Command.define do
        name  'cache'
        usage 'cache'
        summary 'Update cache for all sources'

        run do |opts, args, cmd|
          sources = R10K::Deployment.config[:sources]
          remotes = Set.new

          sources.each_pair do |name, hash|
            remotes << hash['remote']
          end

          remotes.each do |remote|
            logger.info "Updating cache for #{remote.inspect}"
            synchro = R10K::Synchro::Git.new(remote)
            synchro.cache
          end
        end
      end
    end
  end
  self.command.add_command(Cache.command)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
r10k-0.0.9 lib/r10k/cli/cache.rb
r10k-0.0.8 lib/r10k/cli/cache.rb
r10k-0.0.7 lib/r10k/cli/cache.rb