-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCapfile
53 lines (37 loc) · 1.53 KB
/
Capfile
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
40
41
42
43
44
45
46
47
48
49
50
51
# -*- mode:ruby; -*-
require 'rubygems'
require 'railsless-deploy'
require 'bundler/capistrano'
require 'socket'
set :scm, "git"
set :repository, "git://github.com/daitss/silo-pool.git"
set :branch, "master"
set :use_sudo, false
set :user, "daitss"
set :group, "daitss"
set :keep_releases, 4 # default is 5
set :bundle_flags, "--deployment" # --deployment is one of the defaults, we explicitly set it to remove --quiet
set :bundle_without, []
def usage(*messages)
STDERR.puts "Usage: cap deploy -S target=<host:/file/system>"
STDERR.puts messages.join("\n")
STDERR.puts "You may set the remote user and group by using -S who=<user:group> (defaults to #{user}:#{group})."
STDERR.puts "If you set the user, you must be able to ssh to the domain as that user."
STDERR.puts "You may set the branch in a similar manner: -S branch=<branch name> (defaults to #{variables[:branch]})."
exit
end
usage('The deployment target was not set (e.g., target=ripple.fcla.edu:/opt/web-services/sites/silos).') unless (variables[:target] and variables[:target] =~ %r{.*:.*})
_domain, _filesystem = variables[:target].split(':', 2)
set :deploy_to, _filesystem
set :domain, _domain
set :default_environment, {
'PATH' => "/opt/ruby-1.9.3-p545/bin:$PATH",
'RUBY_VERSION' => 'ruby 1.9.3-p545'
}
if (variables[:who] and variables[:who] =~ %r{.*:.*})
_user, _group = variables[:who].split(':', 2)
set :user, _user
set :group, _group
end
role :app, domain
after "deploy:update", "deploy:cleanup"