[英]AWS CDK synth errors out for a Code Pipeline with CodeBuildStep
I am trying to implement an AWS Code-Pipeline using aws-cdk v2.我正在尝试使用 aws-cdk v2 实现 AWS 代码管道。 Here is my code which does not have any errors but errors out while doing a cdk synth.这是我的代码,没有任何错误,但在执行 cdk 合成器时出错。
const pipeline = new CodePipeline(this, "MyPipeline", {
pipelineName: "my-pipeline",
synth: new CodeBuildStep("SynthStep", {
input: CodePipelineSource.codeCommit(repo, "mainline"),
buildEnvironment: {
computeType: CodeBuild.ComputeType.MEDIUM,
buildImage: CodeBuild.LinuxBuildImage.STANDARD_5_0,
},
partialBuildSpec: buildSpec,
commands: [],
role: codeBuildSynthRole,
}),
crossAccountKeys: true,
selfMutation: true,
dockerEnabledForSelfMutation: true,
});
I get an error - 'Only one build spec is allowed to specify artifacts.'我收到一个错误 - “只允许一个构建规范指定工件。” What am i doing wrong?我究竟做错了什么?
You did not show your buildSpec
but I suspect it includes artifacts.您没有显示您的buildSpec
,但我怀疑它包含工件。 CodeBuildStep
creates its own artifacts
element. CodeBuildStep
创建自己的artifacts
元素。 If you view the CDK source by control-clicking in your IDE on the partialBuildSpec
, it says:如果您通过在 partialBuildSpec 上的partialBuildSpec
中按住 control 并单击来查看 CDK 源代码,它会显示:
/**
* Additional configuration that can only be configured via BuildSpec
*
* You should not use this to specify output artifacts; those
* should be supplied via the other properties of this class, otherwise
* CDK Pipelines won't be able to inspect the artifacts.
*
* Set the `commands` to an empty array if you want to fully specify
* the BuildSpec using this field.
*/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.