subcontractor icon indicating copy to clipboard operation
subcontractor copied to clipboard

Load correct .env on --chdir

Open runemadsen opened this issue 12 years ago • 4 comments

When you're using --chdir you often want to load the .env file in the chdir directory, not the directory foreman is run from.

I might take a stab at this.

runemadsen avatar Feb 13 '13 21:02 runemadsen

any luck on this @runemadsen ? Having the same issue myself

yanismydj avatar Aug 27 '13 00:08 yanismydj

No, I didn't have time to look at it unfortunately.

runemadsen avatar Aug 27 '13 13:08 runemadsen

I think you have a couple of options, if you have no conflicting variables, you can load multiple .env files when you start forman

foreman start -env .env dir/.env

Otherwise, someone could take a look at adding in a dependency on something like dotenv so that subcontractor looks for a .env file after the chdir.

pitluga avatar Aug 27 '13 13:08 pitluga

I have 2 rails server processes that I'm trying to run simultaneously(one is a 'fake' service layer for the other to interact with). I'm actually using dotenv already, but I haven't managed to the second rails server instance to load up in a different environment than the first process. I'm still experimenting, if i find a solution, I'll report back. Thanks for the help @pitluga !

yanismydj avatar Aug 27 '13 16:08 yanismydj