[英]point CDK CodePipelineSource to GitHub repo subfolder
Is there a way to point CDK CodePipelineSource to a subfolder of a GitHub repo?有没有办法将 CDK CodePipelineSource 指向 GitHub 存储库的子文件夹? I only want my CodePipeline to be triggered on changes in a specific subfolder in the repo.我只希望我的 CodePipeline 在 repo 中特定子文件夹的更改时触发。 My current setup:我目前的设置:
const githubConnection = CodePipelineSource.connection(
'ExampleOrg/ToolsRepo',
'main',
{
connectionArn: 'arn:aws:codestar-connections:us-west-2:4539727446:connection/jchfjd-hfjksdfhs-kdfjksd-fhjskdlf',
triggerOnPush: true
}
);
const pipeline = new CodePipeline(this, 'Pipeline', {
pipelineName: 'cdk-pipeline-test',
crossAccountKeys: true,
synth: new ShellStep('Synth', {
input: githubConnection,
primaryOutputDirectory: 'cdk-pipeline/cdk.out',
commands: ['cd ./cdk-pipeline','npm ci', 'npm run build', 'npx cdk synth']
})
});
You can't do this directly.你不能直接这样做。 AWS have a blog post explaining how to do it though. AWS 有一篇博客文章解释了如何做到这一点。
Basically you trigger a lambda from the github change and that control which pipelines, if any, are started.基本上,您从 github 更改中触发 lambda 并控制启动哪些管道(如果有)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.