4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Rails】Capistrano main以外のブランチをデプロイする方法

Posted at

通常、mainブランチをcapistranoでデプロイする時、このように入力すると思います。

$ bundle exec cap production deploy

ただ、開発中にmain以外のブランチをデプロイして確認したい時もあると思います。
そんな時は、

config/deploy.rbに追記して

$ set :branch, ENV['BRANCH'] || "main"

デプロイする。

bundle exec cap production deploy BRANCH=ブランチ名

特に指定しなければmainが、main以外ならブランチ名を指定してやれば、それぞれデプロイできます。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?