mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Add more documentation to the generated Capfile
This commit is contained in:
parent
deebb35756
commit
503f326d0e
1 changed files with 12 additions and 12 deletions
|
@ -1,12 +1,7 @@
|
||||||
#!/usr/bin/env cap
|
# Load DSL and Setup Up Stages
|
||||||
# loads dsl, sets up stages
|
|
||||||
require 'capistrano/setup'
|
require 'capistrano/setup'
|
||||||
|
|
||||||
# provides remote execution of arbitrary commands
|
# Includes default deployment tasks
|
||||||
require 'capistrano/console'
|
|
||||||
|
|
||||||
# includes default deployment tasks
|
|
||||||
# remove to start completely from scratch
|
|
||||||
require 'capistrano/deploy'
|
require 'capistrano/deploy'
|
||||||
|
|
||||||
# Includes tasks from other gems included in your Gemfile
|
# Includes tasks from other gems included in your Gemfile
|
||||||
|
@ -20,24 +15,29 @@ require 'capistrano/deploy'
|
||||||
# require 'capistrano/bundler'
|
# require 'capistrano/bundler'
|
||||||
# require 'capistrano/rails/assets'
|
# require 'capistrano/rails/assets'
|
||||||
# require 'capistrano/rails/migrations'
|
# require 'capistrano/rails/migrations'
|
||||||
# require 'capistrano/heroku'
|
|
||||||
|
|
||||||
# Loads custom tasks from lib/capistrano/tasks if you have any defined.
|
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
|
||||||
# Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
|
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
|
||||||
|
|
||||||
namespace :deploy do
|
namespace :deploy do
|
||||||
|
|
||||||
desc 'Restart application'
|
desc 'Restart application'
|
||||||
task :restart do
|
task :restart do
|
||||||
on roles(:app), in: :sequence, wait: 5 do
|
on roles(:app), in: :sequence, wait: 5 do
|
||||||
#
|
# Your restart mechanism here, for example:
|
||||||
|
# execute :touch, release_path.join('tmp/restart.txt')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
after :restart, :clear_cache do
|
after :restart, :clear_cache do
|
||||||
on roles(:web), in: :groups, limit: 3, wait: 10 do
|
on roles(:web), in: :groups, limit: 3, wait: 10 do
|
||||||
#
|
# Here we can do anything such as:
|
||||||
|
# within latest_relese_path do
|
||||||
|
# execute :rake, 'cache:clear'
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
after :finishing, 'deploy:cleanup'
|
after :finishing, 'deploy:cleanup'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue