Sha256: f7ca1877d7e3e03d2148117c1945eeebf8df32614086f613690eee5afbda0d3a

Contents?: true

Size: 1.42 KB

Versions: 4

Compression:

Stored size: 1.42 KB

Contents

######################################################################
#                         ENVIRONMENT CHECKS
#
# Sets up a first-pass environment check for the deployment.
#
# First, an environment MUST be present in order for any deployment
# to happen.  It's a safety measure that this is explicitly stated.
#
# It also checks to make sure that the :application and
# :application_short environment variables have been set.
#
# This happens before any of the capabilities have been added to the
# deployment and therefore that is all we know to check for at this
# point.
#
######################################################################
Capistrano::Configuration.instance(:must_exist).load do
  on      :start,               'environment:check',    :except => ['staging', 'production']

  after   'environment:check',  'capabilities:check', 'notifiers:check'

  namespace :environment do
    desc "[internal] Checks for environment variables shared among all deployment types."
    task :check do
      abort "You need to specify staging or production when you deploy. ie 'cap staging db:backup'" unless exists?(:rails_env)
      abort "You need to specify a deployment type in your application's 'deploy.rb' file. ie 'set :deployment_type, :heroku'" unless exists?(:deployment_type)

      required_variables = [
        :application,
        :application_short
      ]

      verify_variables(required_variables)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chicken_soup-0.4.1 lib/chicken_soup/environment/checks.rb
chicken_soup-0.4.0 lib/chicken_soup/environment/checks.rb
chicken_soup-0.3.0 lib/chicken_soup/environment/checks.rb
chicken_soup-0.2.0 lib/chicken_soup/environment/checks.rb