Capistrano3/deploy_via_copyする
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Capistrano3]]
&tag(Capistrano3/deploy_via_copyする);
*目次 [#i7bdbafb]
#contents
*関連ページ [#d98e9a99]
-[[../基本]]
-[[./古い情報]]
*参考情報 [#xcebfe5f]
*capistrano-scm-copyを最初から使う方法 [#ha3bcf1a]
**インストール [#pbd49b81]
-Gemfileを編集。rubyzipが必要なことに注意。
#pre{{
gem 'rubyzip'
group :deployment do
gem 'capistrano'
gem 'capistrano-rails'
gem 'capistrano-rbenv'
gem 'capistrano-bundler'
gem "capistrano-scm-copy"
end
}}
-gemのインストール
bundle install --path vendor/bundle
-cap install実行
bundle exec cap install
**設定ファイルの編集 [#pfa01924]
-Capfileの編集。rbenv、bundler、assets、migrationsあたり...
#pre{{
# 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 h...
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import...
}}
-config/deploy/staging.rb、production.rbの編集
#pre{{
puts "\n\e[0;31m Are you REALLY sure you want to deploy t...
proceed = STDIN.gets
unless proceed =~ /^y/
puts "canceld"
exit
end
set :ssh_options, :forward_agent=>true, :keys=>'~/.ssh/id...
set :deploy_to, '/Users/sora/www/myapp'
server 'bronze', user: 'sora', roles: %w{web}, my_propert...
role :app, %w{bronze}
role :web, %w{bronze}
role :db, %w{bronze}
}}
-config/deploy.rbの編集
#pre{{
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\/*', '...
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tm...
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...
end
end
}}
**使用する [#oc86e354]
-サーバー上で"ls"を実行する"list"タスクを実行
bundle exec cap production list
-deployする
bundle exec cap staging deploy
*capistrano-scm-copyを後から追加する方法[#u725bdde]
-[[wercker/capistrano-scm-copy:https://github.com/wercker...
**設定 [#fddf8ec0]
-Gemfileに以下を追加する
gem "capistrano-scm-copy"
-config/deploy.rbの:scmを変更。exclude_dirに指定したディ...
set :scm, :copy
set :exclude_dir, ['vendor/bundle']
-staging.rb、production.rbの変更
-deploy_toでdeploy先ディレクトリを指定する。staging、prod...
#pre{{
set :deploy_to, '/home/tanaka/www/demoapp'
}}
-公式ドキュメントによろと、Capfileに以下を追加する必要が...
require 'capistrano/copy'
-しかし、[[Appears to try to upload archive file 2x ·...
#pre{{
I had the same problem but could find a proper solution; ...
This problem occurs when we use this module with capistra...
https://github.com/capistrano/capistrano/blob/master/lib/...
Good luck!
}}
*トラブルシューティング [#b298585a]
-[[IMplement the new Capistrano Scm plugin system · Issue...
#pre{{
[Deprecation Notice] `set :scm, :copy` is deprecated.
To ensure this custom SCM will work with future versions ...
please upgrade it to a version that uses the new SCM plug...
documented here:
http://capistranorb.com/documentation/advanced-features/c...
}}
-[[Capistrano 3 でデプロイサーバから対象サーバにコピー - ...
終了行:
[[Capistrano3]]
&tag(Capistrano3/deploy_via_copyする);
*目次 [#i7bdbafb]
#contents
*関連ページ [#d98e9a99]
-[[../基本]]
-[[./古い情報]]
*参考情報 [#xcebfe5f]
*capistrano-scm-copyを最初から使う方法 [#ha3bcf1a]
**インストール [#pbd49b81]
-Gemfileを編集。rubyzipが必要なことに注意。
#pre{{
gem 'rubyzip'
group :deployment do
gem 'capistrano'
gem 'capistrano-rails'
gem 'capistrano-rbenv'
gem 'capistrano-bundler'
gem "capistrano-scm-copy"
end
}}
-gemのインストール
bundle install --path vendor/bundle
-cap install実行
bundle exec cap install
**設定ファイルの編集 [#pfa01924]
-Capfileの編集。rbenv、bundler、assets、migrationsあたり...
#pre{{
# 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 h...
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import...
}}
-config/deploy/staging.rb、production.rbの編集
#pre{{
puts "\n\e[0;31m Are you REALLY sure you want to deploy t...
proceed = STDIN.gets
unless proceed =~ /^y/
puts "canceld"
exit
end
set :ssh_options, :forward_agent=>true, :keys=>'~/.ssh/id...
set :deploy_to, '/Users/sora/www/myapp'
server 'bronze', user: 'sora', roles: %w{web}, my_propert...
role :app, %w{bronze}
role :web, %w{bronze}
role :db, %w{bronze}
}}
-config/deploy.rbの編集
#pre{{
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\/*', '...
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tm...
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...
end
end
}}
**使用する [#oc86e354]
-サーバー上で"ls"を実行する"list"タスクを実行
bundle exec cap production list
-deployする
bundle exec cap staging deploy
*capistrano-scm-copyを後から追加する方法[#u725bdde]
-[[wercker/capistrano-scm-copy:https://github.com/wercker...
**設定 [#fddf8ec0]
-Gemfileに以下を追加する
gem "capistrano-scm-copy"
-config/deploy.rbの:scmを変更。exclude_dirに指定したディ...
set :scm, :copy
set :exclude_dir, ['vendor/bundle']
-staging.rb、production.rbの変更
-deploy_toでdeploy先ディレクトリを指定する。staging、prod...
#pre{{
set :deploy_to, '/home/tanaka/www/demoapp'
}}
-公式ドキュメントによろと、Capfileに以下を追加する必要が...
require 'capistrano/copy'
-しかし、[[Appears to try to upload archive file 2x ·...
#pre{{
I had the same problem but could find a proper solution; ...
This problem occurs when we use this module with capistra...
https://github.com/capistrano/capistrano/blob/master/lib/...
Good luck!
}}
*トラブルシューティング [#b298585a]
-[[IMplement the new Capistrano Scm plugin system · Issue...
#pre{{
[Deprecation Notice] `set :scm, :copy` is deprecated.
To ensure this custom SCM will work with future versions ...
please upgrade it to a version that uses the new SCM plug...
documented here:
http://capistranorb.com/documentation/advanced-features/c...
}}
-[[Capistrano 3 でデプロイサーバから対象サーバにコピー - ...
ページ名: