New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer runtime env values over .env values #711
base: main
Are you sure you want to change the base?
Prefer runtime env values over .env values #711
Conversation
This looks good, but can you please rebase it with recent merged changes? |
c806e6d
to
27a017e
Compare
@ddollar thanks for taking a look! Rebased. |
@ddollar any chance to take a look at this PR? Thank you in advance! |
This is a great feature, we were just looking for this. Thank you @NAR8789 👍 |
Reference for anyone else coming to this PR: There is a workaround in the discussion in Issue #561. tl;dr start foreman with This suppresses foreman's I suspect actually that most applications are like this, in that the right thing to do is suppress foreman's (also, sorry for the notification spam--I posted with the wrong account earlier) |
@NAR8789 thanks a lot for the workaround. Can you confirm that if you use |
@scalp42 sure! try the following: mkdir foreman-nullenv
cd foreman-nullenv
echo 'env: env' > Procfile # create a procfile that just prints your env
foreman start # run it! here you should get output corresponding to your exported shell env. You can play around with creating a Then try with foreman start -e /dev/null Here you should get your original env again. If this nullified environment, you'd get no output. Try playing around with exporting additional env vars, or specifying env vars on the same line as In actual development, I point foreman at a file containing an explanatory comment (instead of
|
@NAR8789 thanks a lot for the help! Much appreciated 🙇 |
Hi ! Any status on this one ? I chased a bug for hours before finding that it was due to this foreman behaviour :( Thanks ! |
@ddollar any chance to get this merged? |
27a017e
to
dba8a50
Compare
run
andstart
, but notexport
.env
or via-e
.env
, similar to dotenvdotenv
in thatdotenv
always prefers earlier-defined variables, even within listed files. Foreman's existing behavior was to prefer later-defined variables in listed files, so I have kept this ordering for now. This would be easy to reverse if preferred