Class: Ahn::Generators::DeploymentGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/ahn/deployment/deployment_generator.rb

Instance Method Summary collapse

Methods inherited from Base

banner, source_root

Instance Method Details

#create_god_configObject



8
9
10
11
# File 'lib/generators/ahn/deployment/deployment_generator.rb', line 8

def create_god_config
  template "general.god", "config/all.god"
  template "adhearsion.god", "config/god/adhearsion.god"
end

#use_god_via_capistranoObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/generators/ahn/deployment/deployment_generator.rb', line 13

def use_god_via_capistrano
  return unless got_capistrano?

  append_file "config/deploy.rb", <<-STRING
after 'deploy:restart', 'deploy:restart_adhearsion'
role :adhearsion, "adhearsion.domain.com"
namespace :deploy do
  task :restart_adhearsion, :roles => :adhearsion do
    sudo "god load \#{release_path}/config/all.god"
    sudo "god restart #{project_name}-adhearsion"
  end
end
  STRING
end