serverless / template

Compose & provision a collection of Serverless Components
https://serverless.com
Apache License 2.0
10 stars 6 forks source link

Env variables when programmatically loading template #10

Open barrysteyn opened 4 years ago

barrysteyn commented 4 years ago

@Pavel910 mentions in the README that when loading a template programmatically, one can associate it with any .env:

That way you can deploy unlimited environments, add pre/post processing, load whatever .env you need, etc.

How would "whatever .env you need" be loaded? The only way I can think of loading env variables is to set it in process.env. This does not seem correct, is there a better way of doing things? If so, can the README be updated.

Pavel910 commented 4 years ago

Since components do not have a built-in concept of stages or environments, you can handle your --env argument and load an appropriate env config file using, for example, env-cmd.

No time for PR, sorry,