My apologies if I'm missing something here.
We have setup a 2 stage pipeline, staging and production concerning a single app called api. Within our manifest we utilise the environments key to describe different environment variables depending on the copilot environment.
When testing this out via copilot svc package command the CloudFormation correctly outputs the correct variable values depending on the environment given.
Within the buildspec.yml this package command in run for each environment, outputting api.stack.yml and a api-[env].params.json file. The api.stack.yml file is overwritten each loop, leaving the last environment winning. This leaves all stages of the pipeline using the environment variables using a single environment's config.
Heya @brudil ! Sorry for the inconvenience, your explanation makes sense to me and it sounds like a bug.
We'll update the issue by trying to reproduce the issue and let you know
Thanks @brudil for bring this up! We are able to reproduce the issue and working on a fix to it.
@iamhopaul123 thanks. Is there a workaround to the issue until the fix is released?
Unfortunately I cannot think of any easy way to workaround this issue.
Possible workaround:
Put test and prod env in different applications and make two identical services deploying to each of them.
If you are not using the pipeline then this env override issue might not happen.
Heya @brudil the fixed was released last Friday (10/23) with v0.5.0: https://github.com/aws/copilot-cli/releases/tag/v0.5.0 !
Amazing, thanks for this project!
Most helpful comment
Thanks @brudil for bring this up! We are able to reproduce the issue and working on a fix to it.