Multistage な Capistrano with Rails
1870 ワード
複数環境にデプロイできるようにするため、capistrano-ext を使っていると思いますが、本体に取り込まれていたので、使い方のメモ。
Before(本体とは別で配布されていたころ)
Gemfile
gem 'capistrano'
gem 'capistrano-ext'
deploy.rb
require "capistrano/ext/multistage"
で、config/deploy 以下に {環境名}.rb というファイルを作ると、それぞれの環境を認識し、環境ごとの設定が記述できる
After(本体同梱)
Gemfile
gem 'capistrano'
deploy.rb
require "capistrano/ext/multistage"
set :stages, %w(staging production)
set :default_stage, "staging"
config/deploy 配下にファイルを作る部分は一緒。
環境を明示的に書く必要があるのが、変更点か。デフォルトを設定できるのは、ミスオペを考えると安全側に倒しておけるから、ありがたいかも。
参考資料
Author And Source
この問題について(Multistage な Capistrano with Rails), 我々は、より多くの情報をここで見つけました https://qiita.com/misopeso/items/2db2d791eb4c226ed5dc著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .