I am setting up a production and a pre-production server with Jelastic and nginx to run Ruby on Rails on.
My database name and password are in environment variables. I have set them in the shell via ssh in .bashrc
and in /etc/nginx/app_servers/nginx-passenger.conf
as documented in Configuration reference
for Passenger + Nginx
but rake_deploy
can not find them. I have written a rake-task that outputs the ENV, so I can see that it is not the same when I run the task as a part of deploy and from command-line over ssh. The Rails app gets them through the passenger.conf
, so that works, but is scary duplication.
Is there a way to have my environment-variables set in one place in that setup so that both the Rails app, the rake_deploy
and the shell can access them?