简体   繁体   English

将 CDK CodePipelineSource 指向 GitHub 存储库子文件夹

[英]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.

相关问题 Github OAuth TypeScript 创建仓库 - Github OAuth TypeScript create repo 目标入口点“@angular/cdk/platform”缺少依赖项 - The target entry-point “@angular/cdk/platform” has missing dependencies 如何从github repo安装打字稿定义 - how to install typescript definitions from github repo 可以在 AWS Codepipeline IAC STAGE 流(非源)中提取 github 存储库吗? - Possible to pull github repo in AWS Codepipeline IAC STAGE flow (not source)? 将 github 存储库中的打字稿代码添加到 angular 项目中 - adding typescript code from a github repo into angular project 导出 ECS Fargate 容器的 TaskID 并稍后在 AWS CDK 代码中使用它 - Exporting TaskID of ECS Fargate container and use it later point in AWS CDK code 即使使用 github 回购中的示例,dynogels 总是告诉我无效的架构内容 - dynogels always tells me Invalid schema content even when using examples from it's github repo 在 react 中获取 github 存储库会给出“模块“流”已被外部化以实现浏览器兼容性并且无法在客户端代码中访问”错误 - Fetching a github repo in react gives a "Module "stream" has been externalized for browser compatibility and cannot be accessed in client code" error 在 Amazon CDK 中引用 TableStreamArn - Referencing TableStreamArn in Amazon CDK 如何设计CDK项目? - How to design CDK project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM