Skip to content

Unable to always load env file in CI #79

@altbdoor

Description

@altbdoor

Background

I used deployctl before this in order to deploy Deno projects. Currently I am trying to migrate the deployment process over to deploy-cli, but I find myself unable to always override existing env variables in the CI.

Just as a rough example:

- name: Load env from secure store
  run: |
    aws secretsmanager get-secret-value --secret-id "FOO" --query SecretString --output text > temp.env
    aws secretsmanager get-secret-value --secret-id "BAR" --query SecretString --output text >> temp.env
    deno deploy env load ./temp.env

The CI process above will be stuck in deno deploy env load, as it is awaiting a keypress.

deploy-cli/deploy/env.ts

Lines 310 to 318 in 92610a9

if (updateEnvVars.length > 0) {
console.log("The following env vars are already defined:");
for (const updateEnvVar of updateEnvVars) {
console.log(` - ${updateEnvVar.key}`);
}
console.log();
outer: while (true) {
const res = prompt(
"Would you like to replace these with your .env file? [y = Yes, n = No, s = Ignore/Skip]",

Question

Having a local code in my project to diff the env variables before deciding to create/update will be needlessly complex, and also involves lots of requests/turnaround time. Does the team intend to add a --force flag, or check for CI env variables in order to always replace the env variables?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions