Tag: Capistrano3/deploy_via_copyする
gem 'rubyzip' group :deployment do gem 'capistrano' gem 'capistrano-rails' gem 'capistrano-rbenv' gem 'capistrano-bundler' gem "capistrano-scm-copy" end
bundle install --path vendor/bundle
bundle exec cap install
# 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
#
# 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/*.rake').each { |r| import r }
puts "\n\e[0;31m Are you REALLY sure you want to deploy to production? \e[0m\n"
proceed = STDIN.gets
unless proceed =~ /^y/
puts "canceld"
exit
end
set :ssh_options, :forward_agent=>true, :keys=>'~/.ssh/id_rsa.myapp_np', :auth_methods=>%w(publickey)
set :deploy_to, '/Users/sora/www/myapp'
server 'bronze', user: 'sora', roles: %w{web}, my_property: :my_value
role :app, %w{bronze}
role :web, %w{bronze}
role :db, %w{bronze}
set :application, 'myapp'
set :rbenv_ruby, File.read('.ruby-version').strip
set :scm, :copy
set :include_dir, ["*", '.ruby-version']
set :exclude_dir, ['vendor/bundle', 'log\/*', 'tmp\/*', 'mydb\/*']
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle')
set :keep_releases, 3
task :list do
on roles(:web) do |host|
execute "ls"
end
end
namespace :deploy do
namespace :deploy do
after :restart, :restart_passenger do
on roles(:web), in: :groups, limit: 3, wait: 10 do
within release_path do
execute :touch, 'tmp/restart.txt'
end
end
end
after :finishing, 'deploy:restart_passenger', 'deploy:cleanup'
end
end
bundle exec cap production list
bundle exec cap staging deploy
gem "capistrano-scm-copy"
set :scm, :copy set :exclude_dir, ['vendor/bundle']
set :deploy_to, '/home/tanaka/www/demoapp'
require 'capistrano/copy'
I had the same problem but could find a proper solution; remove require 'capistrano/copy' anywhere! This problem occurs when we use this module with capistrano/setup because capistrano/setup loads a scm module with the :scm value. https://github.com/capistrano/capistrano/blob/master/lib/capistrano/setup.rb#L18 Good luck!