Sha256: 55881db02054abab2f3277900e76ad4b65ab38a7fa4a0eec1a6f8941f0982c7c

Contents?: true

Size: 868 Bytes

Versions: 11

Compression:

Stored size: 868 Bytes

Contents

require_relative 'base'

module VagrantPlugins
  module Berkshelf
    module Action
      class Install < Base
        def call(env)
          if !berkshelf_enabled?(env)
            @logger.info "Berkshelf disabled, skipping"
            return @app.call(env)
          end

          if !provision_enabled?(env)
            @logger.info "Provisioning disabled, skipping"
            return @app.call(env)
          end

          vendor(env)
          @app.call(env)
        end

        # Vendor the cookbooks in the Berkshelf shelf.
        def vendor(env)
          shelf = env[:berkshelf].shelf
          env[:machine].ui.info "Updating Vagrant's Berkshelf..."

          options = env[:machine].config.berkshelf.to_hash

          result = berks('vendor', shelf, options)
          env[:machine].ui.output(result.stdout)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
vagrant-berkshelf-nochefdk-6.0.0 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-5.1.2 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-5.1.1 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-5.1.0 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-5.0.0 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-4.1.0 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-4.0.4 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-4.0.3 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-4.0.2 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-4.0.1 lib/vagrant-berkshelf/action/install.rb
vagrant-berkshelf-4.0.0 lib/vagrant-berkshelf/action/install.rb