Class: Easy::DeploymentGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
GeneratorHelpers
Defined in:
lib/easy/generators/deployment_generator.rb

Instance Method Summary collapse

Methods included from GeneratorHelpers

#application_name

Instance Method Details

#create_deployment_filesObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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