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

Error: Cannot find .env.me (DOTENV_ME) #343

Open
roman-supy-io opened this issue Jun 20, 2024 · 3 comments
Open

Error: Cannot find .env.me (DOTENV_ME) #343

roman-supy-io opened this issue Jun 20, 2024 · 3 comments

Comments

@roman-supy-io
Copy link

I'm using --dotenvMe flag to pass the key instead of using .env.me and due to how our CICD (Tekton) is configured, we cannot use .env.me

The problem is that running this locally even without .env.me works fine:

npx --yes dotenv-vault pull -m=it_........

but running the same in Docker does not:

........

ARG BUILD_CONFIG=development
ARG DOTENV_ME

........

RUN echo "BUILD_CONFIG is: $BUILD_CONFIG" # outputs "production"
RUN echo "ENV.ME is: $DOTENV_ME" # outputs "it_...."

RUN npx --yes dotenv-vault pull -m=$DOTENV_ME $BUILD_CONFIG .env.$BUILD_CONFIG

the error is:

INFO[0233] RUN DOTENV_ME=$DOTENV_ME npx --yes dotenv-vault@latest pull -m=$DOTENV_ME $BUILD_CONFIG .env.$BUILD_CONFIG 
INFO[0236] Cmd: /bin/sh                                 
INFO[0236] Args: [npx --yes dotenv-vault@latest pull -m=$DOTENV_ME $BUILD_CONFIG .env.$BUILD_CONFIG] 
INFO[0236] Running: [/bin/sh npx --yes dotenv-vault@latest pull -m=$DOTENV_ME $BUILD_CONFIG .env.$BUILD_CONFIG] 
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
remote:   Securely pulling development... aborting
x Aborted.
Code: NOT_FOUND_DOTENV_ME
Suggestion: run command: $ npx dotenv-vault login
 ›   Error: Cannot find .env.me (DOTENV_ME)
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 2

any thoughts?

@motdotla
Copy link
Member

motdotla commented Jun 20, 2024

i think $DOTENV_ME needs to be wrapped in quotes here to work correctly with sh. can you try that?

-m="$DOTENV_ME"

@roman-supy-io
Copy link
Author

i think $DOTENV_ME needs to be wrapped in quotes here to work correctly with sh. can you try that?

-m="$DOTENV_ME"

@motdotla unfortunately that didn't work :(

@roman-supy-io
Copy link
Author

@motdotla can you try to reproduce with a simple Dockerfile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants