Help us understand the problem. What is going on with this article?

Multistage な Capistrano with Rails

More than 5 years have passed since last update.

複数環境にデプロイできるようにするため、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 配下にファイルを作る部分は一緒。

環境を明示的に書く必要があるのが、変更点か。デフォルトを設定できるのは、ミスオペを考えると安全側に倒しておけるから、ありがたいかも。

参考資料

https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension

misopeso
Software Developer, Java, Ruby, Rails, Configuration Management, Continuous Integration/Delivery, LBS, Social Media, UI/UX Design, iPhone, Mac
wasoo
株式会社和聡は、「創造し、実現する」ソフトウェア開発集団です。
http://www.wasoo.net/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした