Sha256: 8a0dc52a96e66400fdcf11c8b5dabbe3fb1ccdd5196f654754cb6a850c593754

Contents?: true

Size: 1.14 KB

Versions: 50

Compression:

Stored size: 1.14 KB

Contents

module R10K
  module Action
    module Deploy
      module DeployHelpers

        # Ensure that a config file has been found (and presumably loaded) and exit
        # with a helpful error if it hasn't.
        #
        # @raise [SystemExit] If no config file was loaded
        def expect_config!
          if @config.nil?
            logger.fatal(_("No configuration file given, no config file found in current directory, and no global config present"))
            exit(8)
          end
        end

        # Check to see if the deploy write_lock setting has been set, and log the lock message
        # and exit if it has been set.
        #
        # @param config [Hash] The r10k config hash
        #
        # @raise [SystemExit] if the deploy write_lock setting has been set
        def check_write_lock!(config)
          write_lock = config.fetch(:deploy, {})[:write_lock]
          if write_lock
            logger.fatal(_("Making changes to deployed environments has been administratively disabled."))
            logger.fatal(_("Reason: %{write_lock}") % {write_lock: write_lock})
            exit(16)
          end
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
r10k-3.12.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.11.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.10.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.9.3 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.9.2 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.9.1 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.9.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.8.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.7.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.6.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-2.6.9 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.5.2 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.5.1 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.5.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.4.1 lib/r10k/action/deploy/deploy_helpers.rb
r10k-2.6.8 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.4.0 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.3.3 lib/r10k/action/deploy/deploy_helpers.rb
r10k-3.2.3 lib/r10k/action/deploy/deploy_helpers.rb
r10k-2.6.7 lib/r10k/action/deploy/deploy_helpers.rb