RichGuk (owner)

Fork Of

Revisions

gist: 64105 Download_button fork
public
Public Clone URL: git://gist.github.com/64105.git
Embed All Files: show embed
config/deploy/production.rb #
1
2
set :branch, "production"
 
config/deploy/staging.rb #
1
set :branch, "master"
deploy.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
set :stages, %w(production staging)
require 'capistrano/ext/multistage'
 
server "67.207.136.195", :app, :web, :db, :primary => true
 
set :user, 'nkumar'
set :keep_releases, 3
set :repository, "git@github.com:neerajdotname/gitlearn.git" # replace neerajdotname with your github username
set :use_sudo, false
set :scm, :git
set :deploy_via, :copy
 
# this will make sure that capistrano checks out the submodules if any
set :git_enable_submodules, 1
 
set(:application) { "gitlearn_#{stage}" } # replace gitlearn with your application name
set (:deploy_to) { "/home/#{user}/apps/#{application}" }
set :copy_remote_dir, "/home/#{user}/tmp"
 
# source: http://tomcopeland.blogs.com/juniordeveloper/2008/05/mod_rails-and-c.html
namespace :deploy do
  desc "Restarting mod_rails with restart.txt"
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "touch #{current_path}/tmp/restart.txt"
  end
 
  [:start, :stop].each do |t|
    desc "#{t} task is a no-op with mod_rails"
    task t, :roles => :app do ; end
  end
  
  desc "invoke the db migration"
  task:migrate, :roles => :app do
    send(run_method, "cd #{current_path} && rake db:migrate RAILS_ENV=#{stage} ")
  end
  
end