From 503f326d0ea285b9458e0af3d78d932f01a54e1d Mon Sep 17 00:00:00 2001 From: Lee Hambley Date: Tue, 28 May 2013 19:00:44 +0200 Subject: [PATCH] Add more documentation to the generated Capfile --- lib/capistrano/templates/Capfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/capistrano/templates/Capfile b/lib/capistrano/templates/Capfile index e2af1abb..731be374 100644 --- a/lib/capistrano/templates/Capfile +++ b/lib/capistrano/templates/Capfile @@ -1,12 +1,7 @@ -#!/usr/bin/env cap -# loads dsl, sets up stages +# Load DSL and Setup Up Stages require 'capistrano/setup' -# provides remote execution of arbitrary commands -require 'capistrano/console' - -# includes default deployment tasks -# remove to start completely from scratch +# Includes default deployment tasks require 'capistrano/deploy' # Includes tasks from other gems included in your Gemfile @@ -20,24 +15,29 @@ require 'capistrano/deploy' # require 'capistrano/bundler' # require 'capistrano/rails/assets' # require 'capistrano/rails/migrations' -# require 'capistrano/heroku' -# Loads custom tasks from lib/capistrano/tasks if you have any defined. -# Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. +Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } namespace :deploy do + desc 'Restart application' task :restart 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 after :restart, :clear_cache 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 after :finishing, 'deploy:cleanup' + end