forge variables set appKey xxxxx.xxxx
forge variables set connectBaseUrl https://xxxxxxxx.com
when i try to use
forge lint --environment shivtest
Gives below error:
0:0 error manifest.yml failed to parse content - could not find environment variable ‘appKey’ valid-yaml-required
Error: Command failed due to validation error.
Rerunning the command with --verbose may give more details.
Is this a correct way of doing thing?
I wanted to set different keys and connect urls for different environment.
Initially i tried using placeholder and then replacing using custom deploy.js script, however forge lint gives error in that case as well.
According to that, it would seem(?) that setting variables using forge variables set VAR value is only for runtime use (e.g. accessed via process.env in the app code) and shouldn’t be needed for manifest variables?
So my question is:
When I run forge deploy to deploy my app to different environments (and later, forge install to install the app), do I need to have these variables set in the environment with forge variables set …?
Edit: Also just adding to this….if I remove the environment key from my manifest and run forge lint, it doesn’t complain. Is the following statement from the reference docs still true?
An environment variable must first be declared in environment.variables before it can be used elsewhere in the manifest file:
do I need to have these variables set in the environment with forge variables set …
No, that’s a separate mechanism for setting variables to be accessed by the app code at runtime rather than interpolated into the manifest - e.g. via process.env.
Is the following statement from the reference docs still true?
Yes. Without declaring the environment variable it won’t be interpolated, the variable reference will be treated as a literal value - i.e. your base url will be set to “${BASE_URL}”