Closed acarlstein closed 1 year ago
If you look carefully, you'd notice that UI shows curly braces and you use round braces. :) That is to say that EnvFile emulates bash-like interpolation, but does not actually execute commands within $(...)
.
That being said, as of last release when you specify a file, you can mark it as executable and this way EnvFile will run it and interpret stdout as .env or JSON/YAML depending on your settings.
You can create a file that would execute gcloud
and output the env vars, and run that file with EnvFile to get them into your run configuration.
Summary
First, thank you for taking a look into the current issue I created. Much appreciated.
I need some environment variables, which are required for the Spring Boot app to run, which values are obtained from the Secret Manager in GCP.
Description
Normally, if I do the following, it works:
1) I create a file with the exports (i.e.: .envs):
2) I run the command `source .envs'
3) I run the command
env
and I can see that thegcloud
command was executed.EVENTHUB_ACCESS_KEY=access+key+would+extracted+and+shown+here=
However, this isn't the case with IntelliJ and EnvFile.
In IntelliJ, If I add the export here:
Then, the
gcloud
command isn't executed.In EnvFile, If I add the following to the
.env
file, per the instructions, and set this as:or
Then, it does the same thing.
Acceptance Criteria
I would like to be able to add the line below, into the
.env
file, and have thegcloud
command executed:So, when I run the Spring Boot in IntelliJ, I can see the environment variable (or see the values via adding a breakpoint) with this code example: