Reputation: 1392
I am trying to export a variable value from the CodeBuild Stage of AWS code-pipeline but the value is not resolving
Note: Windows container's PowerShell is executing the commands of buildspec.yml
Example: I am setting an Input environment variable named Client like below in the AWS CodeBuild project
and to export the same value I have modified my buildspec.yml like below
version: 0.2
env:
variables:
ClientEnv: $(echo $Client)
exported-variables:
- ClientEnv
but the exported value is expression not the resolved value
I have also tried passing variables but seems not working.
How I can pass the environment variables to exported-variables in such a scenario
Thanks in advance.
Upvotes: 0
Views: 6410
Reputation: 314
If the name of the variable is Client as defined in the Env. Vars of CodeBuild project thenthe following is enough. You dont need to redefine the same variable in the env->variables section
env:
exported-variables:
- Client
Upvotes: 0
Reputation: 182
You need to change your code as is:
env:
exported-variables:
- Client
Upvotes: 1