sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.11k stars 131 forks source link

Add CLI support for sourcing env from different files #350

Closed colemahatmccreary closed 2 months ago

colemahatmccreary commented 2 months ago

Opening this at Dax's request: https://discord.com/channels/983865673656705025/1177071497974648952/1234854834696618024

The CLI should support automatically sourcing environment variables from a stage-specific file (e.g. .env.$stage) if available

It should also provide an override argument allowing you to specify a path to any arbitrary .env file

thdxr commented 2 months ago

oh turns out we already support .env.<stage>

colemahatmccreary commented 2 months ago

So to override this behavior should i just use dotenv?

i could explain my use case more, but basically i need multiple stages (other than prod and dev) to share the same set env variables (e.g. every feature branch deploys to --stage=<branchname> but should all source from .env.feature

Also, in CICD like as github actions, will the CLI still source from the env variables set at the action/step level?