Created
October 10, 2013 11:12
-
-
Save takuyan/6916741 to your computer and use it in GitHub Desktop.
Upgrade to Capistrano 3.0 ref: http://qiita.com/katton/items/e5cca6c4f94d140ae2d6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :development do | |
# ... | |
gem 'capistrano' | |
gem 'capistrano-rails' | |
gem 'capistrano-rbenv' | |
gem 'capistrano-bundler' | |
# ... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load DSL and Setup Up Stages | |
require 'capistrano/setup' | |
# Includes default deployment tasks | |
require 'capistrano/deploy' | |
# Includes tasks from other gems included in your Gemfile | |
# | |
# For documentation on these, see for example: | |
# | |
# https://github.com/capistrano/rvm | |
# https://github.com/capistrano/rbenv | |
# https://github.com/capistrano/chruby | |
# https://github.com/capistrano/bundler | |
# https://github.com/capistrano/rails/tree/master/assets | |
# https://github.com/capistrano/rails/tree/master/migrations | |
# | |
# require 'capistrano/rvm' | |
# require 'capistrano/rbenv' | |
# require 'capistrano/chruby' | |
# require 'capistrano/bundler' | |
# require 'capistrano/rails/assets' | |
# require 'capistrano/rails/migrations' | |
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load DSL and Setup Up Stages | |
require 'capistrano/setup' | |
# Includes default deployment tasks | |
require 'capistrano/deploy' | |
require 'capistrano/rbenv' | |
set :rbenv_type, :user # or :system, depends on your rbenv setup | |
set :rbenv_ruby, '2.0.0-p247' | |
require 'capistrano/bundler' | |
require 'capistrano/rails' | |
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :deploy do | |
desc 'Restart application' | |
task :restart do | |
on roles(:app), in: :sequence, wait: 5 do | |
# Your restart mechanism here, for example: | |
execute :mkdir, '-p', release_path.join('tmp') # <= これを追加する | |
execute :touch, release_path.join('tmp/restart.txt') | |
end | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment