forked from alejandrogq/rails3-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcapistrano.rb
58 lines (45 loc) · 1.54 KB
/
capistrano.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
app_name = ask "\r\n\r\nEnter the application name:"
server = ask "\r\n\r\nEnter the servername or IP:"
hoptoad = yes?"\r\n\r\nDo you want to include hoptoad notifier in your capistrano configuration? (yes/no)"
gem "capistrano"
gem "capistrano-ext", :require => "capistrano"
run "cp config/environments/production.rb config/environments/staging.rb"
run "bundle install"
capify!
file 'config/deploy/staging.rb', <<-FILE
#############################################################
# Settings
#############################################################
set :rails_env, "staging"
# Application Settings
set :application, "#{app_name}"
set :user, "deploy"
set :deploy_to, "/var/rails/#{app_name}_staging"
set :use_sudo, false
set :keep_releases, 5
# Server Roles
role :web, "#{server}"
role :app, "#{server}"
role :db, "#{server}", :primary => true
FILE
file 'config/deploy/production.rb', <<-FILE
#############################################################
# Settings
#############################################################
set :rails_env, "production"
# Application Settings
set :application, "#{app_name}"
set :user, "deploy"
set :deploy_to, "/var/rails/#{app_name}_production"
set :use_sudo, false
set :keep_releases, 5
# Server Roles
role :web, "#{server}"
role :app, "#{server}"
role :db, "#{server}", :primary => true
FILE
file 'config/deploy.rb', <<-FILE
FILE
git :add => '.'
git :commit => '-m "Capistrano"'