Skip to content

Feature Proposal: deployctl projects env subcommand #375

@magurotuna

Description

@magurotuna

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions