-
Notifications
You must be signed in to change notification settings - Fork 65
Description
As reported in #311, deployctl has an issue where creating a new deployment with a specific env var like deployctl deploy --env causes the build to fail if the deployed app throws an error when this env var is not present.
// If the app has this kind of code, the build fails even with appropriate `--env` option
if (Deno.env.get("MY_ENV") === undefined) {
throw new Error("MY_ENV is required");
}The most straightforward workaround for this issue is to set the required env vars as project-scoped ones, rather than deployment-scoped ones (note that env vars specified in --env or --env-file in deployctl deploy command are deployment-scoped). However, deployctl currently does not have a command that allows users to set project-scoped env vars, so the only way to do that is access the Deno Deploy console and do that on the Web UI. This is definitely not a streamlined experience for users loving CLI.
So I'd like to propose adding a new subcommand deployctl projects env that allows users to add, delete, and update env vars for a project. This would probably support both inlined env vars and reading variables from a file.
This idea came up in a discussion with @kt3k and @skanehira