[pipelines] SimpleSynthAction with subdirectory prop specified produces a wrong buildspec #11424
Labels
@aws-cdk/pipelines
CDK Pipelines library
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
SimpleSynthAction uses
path.join()
function to render path to artifacts. It seems that buildspec requires the path to use forward-slash as a path separator (probably as the synth action runs on Linux), however,path.join()
produces a path with backslashes when synthesis is run on Windows. This should hence be hardcoded to join by forward slash (/
).I believe the bug is here:
https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/pipelines/lib/synths/simple-synth-action.ts#L376
Reproduction Steps
Instantiate a
CdkPipeline
with followingsynthAction
:Run
cdk synth
on Windows machine.What did you expect to happen?
In synth action CodeBuild project's buildspec, the following should be present:
What actually happened?
If synthetized on Windows machine, result is as follows:
This causes the artifact to be packaged incorrectly and the subsequent
UpdatePipeline
action fails as it cannot find the cloud assembly in the expected path.Environment
Other
I will raise a PR to fix this shortly.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: