LoginSignup
8
10

More than 5 years have passed since last update.

Capistranoで環境変数を個別に引き継ぐ

Last updated at Posted at 2016-06-08

したいこと

  • Capistranoで接続先のサーバに環境変数を渡したい

よく出てくる情報

  • set :default_env, {"ENV1" => "VALUE1"}とかやると渡せるよ
  • この方法だと全体に効いてしまう
  • かつ、deploy.rb系列の中で書かないと効かない
    • task系の中で書いても無視される

対応方法

  • withを使うと渡せる
  • on rolesの中じゃないと呼べないので注意
on roles :apsv do
  with {"ENV1" => "VALUE1"} do
    execute :xxx
  end
end
8
10
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
8
10