class Easy::DeploymentGenerator

Public Instance Methods

create_deployment_files() click to toggle source
# File lib/easy/generators/deployment_generator.rb, line 18
    def create_deployment_files
      template("deploy.rb.tt", "config/deploy.rb") # Generate deploy.rb first to use ours not capistrano's deploy.rb
      copy_file("Capfile") unless options[:no_asset_pipeline] # Do this first
      capify!

      # Generate all stages specified
      options[:stages].each do |stage|
        generate("easy:stage", stage)
      end

      install_message = %Q(
Easy Deployment Config now setup!

TODO:
  * Set the correct git repository in config/deploy.rb
  #{"* Edit Capfile and enable asset pipeline compilation if you are using it (uncomment load 'deploy/assets')\n" if options[:no_asset_pipeline]})

      say(install_message, :green)
      options[:stages].each do |stage|
        say("  * Set the ip address for staging in config/deploy/#{stage}.rb && the apache config in config/deploy/#{stage}/apache.conf", :green)
      end

      add_optional_operational_gems

      true
    end

Private Instance Methods

add_optional_operational_gems() click to toggle source
# File lib/easy/generators/deployment_generator.rb, line 47
def add_optional_operational_gems
  needs_bundle = false

  unless options[:disable_newrelic]
    say_status(:configure, "New Relic gem")
    gem("newrelic_rpm", ">= 3.5.3.25")
    needs_bundle = true
  end
  unless options[:disable_bugsnag]
    say_status(:configure, "bugsnag")
    gem("bugsnag")
    needs_bundle = true
  end

  unless options[:disable_backup]
    generate("easy:backup")
    needs_bundle = false # because easy:backup runs bundle install
  end

  bundle_command(:install) if needs_bundle
end