Skip to content

Commit

Permalink
add envfile option
Browse files Browse the repository at this point in the history
  • Loading branch information
sailist committed Mar 14, 2024
1 parent 9ee5fee commit 977932e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion supervisor/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,17 @@ def get(section, opt, *args, **kwargs):

environment = dict_of_key_value_pairs(
expand(environment_str, expansions, 'environment'))


envfile = get(section, "envfile", None)
if envfile is not None:
pass
with open(envfile) as r:
_env = {}
for line in r.readlines():
k, v = line.strip().split('=', maxsplit=1)
_env[k] = v
environment.update(_env)

# extend expansions for process from [program:x] environment definition
for k, v in environment.items():
expansions['ENV_%s' % k] = v
Expand Down

0 comments on commit 977932e

Please sign in to comment.