1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
-1
Since a Docker container is used to build Lambda, it is necessary to set "dockerEnabledForSynth: true" to enable privileged mode during build.
https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_pipelines.CodePipeline.html
So I thought this is how it would look as a code.
Note that "dockerEnabledForSelfMutation: true" must also be added if Docker image Assets are used on CDK Pipelines.
new CodePipeline(this, 'Pipeline', {
pipelineName: 'TestPipeline',
synth: new ShellStep('Synth', {
input: CodePipelineSource.gitHub('ivozmediano/microservicios', 'main'),
commands: [
'npm ci',
'npm run build',
'npx cdk synth',
]
}),
dockerEnabledForSynth: true
});
}
}
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- demandé il y a 2 mois
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a 3 ans
- AWS OFFICIELA mis à jour il y a un an
Hi Riku, I tried your solution but it's still not working, same error. Thanks a lot anyway!
By the way, if I clone CodePipelineSource.gitHub('ivozmediano/microservicios', 'main') locally and run "npm ci", "npm run build", "npx cdk synth" locally, I get error?
Probably, because of credentials
Are there any errors in the npm run build execution log when you run the CDK? You may also want to check if you have successfully cloned from GitHub.
There are no errors in npm run build locally. I tried a different node version and, locally, I can run npx cdk synth, but when I try to deploy code using CodePipeline, error again.