Skip to content
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

consider loading .env.$FOUNDRY_PROFILE in deploy #3565

Open
holic opened this issue Feb 4, 2025 · 3 comments · May be fixed by #3571
Open

consider loading .env.$FOUNDRY_PROFILE in deploy #3565

holic opened this issue Feb 4, 2025 · 3 comments · May be fixed by #3571

Comments

@holic
Copy link
Member

holic commented Feb 4, 2025

would be nice to be able to run only

mud deploy --profile rhodolite

and it load .env.rhodolite for rhodolite specific private key, etc.

@holic holic changed the title consider loading .env.$FOUNDRY_PROFILE consider loading .env.$FOUNDRY_PROFILE in deploy Feb 4, 2025
@holic
Copy link
Member Author

holic commented Feb 5, 2025

also need to add --profile (and prob other deploy options) to mud dev-contracts

@holic
Copy link
Member Author

holic commented Feb 5, 2025

can do env loading right after this line

const profile = opts.profile;

something like

dotenv.config({ path: [`.env.${profile}`] });

@holic
Copy link
Member Author

holic commented Feb 5, 2025

actually, it's unclear if that's the right path, because we will have already loaded .env into the env by then

if someone had PRIVATE_KEY set in .env it wouldn't be overridden by PRIVATE_KEY in .env.$profile

and if we use dotenv.config({ override: true, ... }) then we potentially override any env vars passed directly into the command like PRIVATE_KEY=... mud deploy

so may need to parse the profile arg earlier or move the dotenv.config(...) call later to include both env files at the same time

@holic holic linked a pull request Feb 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant