-
Notifications
You must be signed in to change notification settings - Fork 52
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
[Bug]: deployctl deploy executes entrypoint before setting --env vars #311
Comments
I wonder if I'm misunderstanding the intention of deployment-level envars. Maybe they are not really intended for configuration? I notice that Also the example in the
And env vars set at the project level (e.g via the deploy website) are set during deploy. |
Thanks for the report, this is indeed a bug (or rather current limitation with deployctl). To be clear, there are two levels where we can configure env vars; one is project level and the other is deployment level. As you noticed, setting env vars in the settings page of the Deno Deploy dashboard is the project level configuration, whereas what The current limitation we have with deployment-level env var configuration is as follows: what happens internally in So for now, one possible workaround would be setting the required env vars as the project-level - that is, create a project (or you can reuse the empty project you got as a result of running |
Thanks for the explanation & workaround, that's helpful. |
Problem description
When creating a deployment from the CLI with
deployctl deploy
we can set environment variables with--env
/--env-file
. During deployment, Deno Deploy appears to execute the entrypoint module without the envars set.Steps to reproduce
Create a module/app that requires environment variables to work:
Deploy it with the environment variables set. Deployment fails due to the module being executed without the vars set:
If the throw is removed, deploy proceeds and shows
⠸ Setting environment variables...
after the point that it failed previously.Expected behavior
Environment variables provided should be set when the entrypoint is executed.
Environment
Possible solution
If vars can't be set before executing the entrypoint, maybe provide a way for an app to know it's being executed during deployment as a test, so that it can avoid loading config & failing if it's not available?
Additional context
No response
The text was updated successfully, but these errors were encountered: