-
Notifications
You must be signed in to change notification settings - Fork 2
/
base.rb
29 lines (21 loc) · 974 Bytes
/
base.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
Capistrano::Configuration.instance(:must_exist).load do
set :scm, :git
set :appdir, application
set :deploy_via, :remote_cache
set :deploy_to, "/home/#{user}/a/#{application}"
set :use_sudo, false
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
after "deploy", "deploy:cleanup" # keep only the last 5 releases
# ---------------------------------------------------------------------------------
# see http://henriksjokvist.net/archive/2012/2/deploying-with-rbenv-and-capistrano/
require "bundler/capistrano"
set :bundle_flags, "--deployment --quiet --binstubs --shebang ruby-local-exec"
# also see http://ryan.mcgeary.org/2011/02/09/vendor-everything-still-applies/
# ---------------------------------------------------------------------------------
# get sudo password at the beginning of the run
task :sudo_setup, :roles => :app do
run "#{sudo} date"
end
before "deploy", "sudo_setup"
end