Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano: How to set global environment variable?

I need to find a way to set global env variable from Capistrano. Actual value is generated on in runtime, I can not check it in the repo and load from there.

This value must be loaded as ENV['RAILS_ASSET_ID'] in one initializer.

How can I do so?

like image 897
Nikita Fedyashev Avatar asked Dec 04 '25 19:12

Nikita Fedyashev


1 Answers

Can't you use the default_environment capistrano variable ? cf github/capistrano

For instance, we can use it for rbenv in production :

set :default_environment, {
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}
like image 90
Flackou Avatar answered Dec 06 '25 11:12

Flackou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!