|
45 | 45 | After { ENV.delete 'SKIP_MIGRATIONS' }
|
46 | 46 |
|
47 | 47 | Then 'Capistrano should be configured' do
|
| 48 | + steps %( |
| 49 | + And the file "Gemfile" should contain "capistrano-rails" |
| 50 | + And the file "Gemfile" should contain "capistrano-bundler" |
| 51 | + And the file "Gemfile" should contain "capistrano-maintenance" |
| 52 | + And the file "Gemfile" should contain "capistrano-opscomplete" |
| 53 | + And the file "Gemfile" should contain "capistrano-passenger" |
| 54 | + ) |
| 55 | + |
48 | 56 | step 'the file "Capfile" should contain:', <<-CONTENT
|
49 | 57 | # Load DSL and set up stages
|
50 | 58 | require 'capistrano/setup'
|
51 | 59 |
|
52 | 60 | # Include default deployment tasks
|
53 | 61 | require 'capistrano/deploy'
|
54 | 62 |
|
| 63 | +# Configure Opscomplete deployment |
| 64 | +require 'capistrano/opscomplete' |
| 65 | +require 'capistrano/passenger' |
| 66 | +
|
55 | 67 | # Use Git
|
56 | 68 | require 'capistrano/scm/git'
|
57 | 69 | install_plugin Capistrano::SCM::Git
|
|
71 | 83 | end
|
72 | 84 |
|
73 | 85 | before 'deploy:updating', 'db:dump'
|
| 86 | +after 'deploy:updating', 'opscomplete:ruby:ensure' |
74 | 87 | after 'deploy:published', 'deploy:restart'
|
75 | 88 | after 'deploy:published', 'db:warn_if_pending_migrations'
|
76 | 89 | after 'deploy:published', 'db:show_dump_usage'
|
|
117 | 130 | set :rails_env, 'staging'
|
118 | 131 | set :branch, ENV['DEPLOY_BRANCH'] || 'master'
|
119 | 132 |
|
120 |
| -# server 'example.com', user: 'deploy-user', roles: %w(app web cron db) |
| 133 | +# server 'example.com', user: 'deploy-user', roles: %w[app web cron db] |
121 | 134 | CONTENT
|
122 | 135 |
|
123 | 136 | step 'the file "config/deploy/production.rb" should contain exactly:', <<-CONTENT
|
|
127 | 140 | set :rails_env, 'production'
|
128 | 141 | set :branch, 'production'
|
129 | 142 |
|
130 |
| -# server 'one.example.com', user: 'deploy-user', roles: %w(app web cron db) |
131 |
| -# server 'two.example.com', user: 'deploy-user', roles: %w(app web) |
| 143 | +# server 'one.example.com', user: 'deploy-user', roles: %w[app web cron db] |
| 144 | +# server 'two.example.com', user: 'deploy-user', roles: %w[app web] |
132 | 145 | CONTENT
|
133 | 146 |
|
134 | 147 | step 'the file "lib/capistrano/tasks/db.rake" should contain ":warn_if_pending_migrations"'
|
135 | 148 | step 'the file "lib/capistrano/tasks/deploy.rake" should contain "Show deployed revision"'
|
136 |
| - step 'the file "lib/capistrano/tasks/passenger.rake" should contain "Restart Application"' |
137 | 149 |
|
138 | 150 | end
|
139 | 151 |
|
|
0 commit comments