Sha256: e94048d336f8509b5ed076b54fc84c732e8c973bb7354d53acf4630a5181a301

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

require 'aws'
require 'opsworks/stack'

module OpsWorks
  module CLI
    module Subcommands
      module UpgradeChef
        # rubocop:disable MethodLength
        # rubocop:disable CyclomaticComplexity
        def self.included(thor)
          thor.class_eval do
            include Helpers::Keychain
            include Helpers::Options

            desc 'upgrade-chef [--stack STACK]', 'Upgrade Chef version'
            option :stack, type: :array
            option :version
            option :manage_berkshelf, type: :boolean, default: false
            def upgrade_chef
              fetch_keychain_credentials unless env_credentials?
              stacks = parse_stacks(options.merge(active: true))
              version = OpsWorks::Stack.latest_chef_version
              stacks.each do |stack|
                say "Upgrading #{stack.name} to #{version}..."
                stack.upgrade_chef(version, options)
              end
            end
          end
        end
        # rubocop:enable CyclomaticComplexity
        # rubocop:enable MethodLength
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opsworks-cli-0.3.4 lib/opsworks/cli/subcommands/upgrade_chef.rb
opsworks-cli-0.3.3 lib/opsworks/cli/subcommands/upgrade_chef.rb
opsworks-cli-0.3.2 lib/opsworks/cli/subcommands/upgrade_chef.rb
opsworks-cli-0.3.1 lib/opsworks/cli/subcommands/upgrade_chef.rb
opsworks-cli-0.3.0 lib/opsworks/cli/subcommands/upgrade_chef.rb
opsworks-cli-0.2.4 lib/opsworks/cli/subcommands/upgrade_chef.rb