Open serverlesspolska opened 2 years ago
I am getting exactly the same behaviour as issue 2 above: "serverless": "^2.71.0", "serverless-export-env": "^2.0.0",
Exactly the same is happening on those versions too
"serverless": "2.70.0", "serverless-export-env": "2.0.0",
Some more information.
Even if this the 1st call to be made, it will still always default to the "dev" environment.
i.e. running serverless export-env --stage test --verbose will always evaluate the "dev" stage, inside the serverless.yml
provider: name: aws stage: ${opt:stage,'dev'}
In my case, I only need to run the export-env for my test env, so by changing the default stage in the "stage" property, means that it will always default to the "test" stage:
provider: name: aws stage: ${opt:stage,'test'}
Hi @arabold,
Recently, I spotted strange behavior which results in wrong environment variables being fetched by the plugin.
I want to highlight that this problem does not occur with Serverless Framework v2.22 installed globally. However, most recent versions since 2.60 suffer from it.
First problem
Locally installed SF does not see
prod
stage.But globally installed SFv2.22 sees
prod
stage.Second problem
The plugin does not fetch properly environment variables, mixes them from different stages. This happens regardless of local / global Serverless Framework installation. In my CI/CD I have globally installed SFv2.60 and the same problem exists. This does not happen on SFv2.22.
For example, on SFv2.64.1 (local)
sls export-env --all -s qa
results in output which is:As you can see, some are from
dev
stage and other fromqa
. All of them should be fromqa
.