aws-cloudformation - AWS CodeBuild : Skipping invalid file path, UPLOAD_ARTIFACTS 状态:失败

标签 aws-cloudformation aws-cdk aws-codepipeline aws-codebuild

我有以下 buildspec.yml

version: 0.2
phases:
  install:
    commands:
      - npm install -g <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c7a6b0b4eaa4a3ac87f6e9f0f5e9f7" rel="noreferrer noopener nofollow">[email protected]</a>
  build:
    commands:
      - cd Lambda
      - cd NetworkRailGateway-Functions
      - for d in ./*/; do (npm install --only=prod); done
      - cd .. 
      - cd RealtimeStations-Functions
      - for d in ./*/; do (npm install --only=prod); done
      - cd .. 
      - cdk synth > cfStack.yml
      - ls
      - pwd
artifacts:
  files:
    - cfStack.yml

ls 命令显示 cfStack.yml 文件存在于当前目录中,但是,我确实收到以下工件错误,这似乎意味着该文件不存在

[Container] 2021/05/20 14:10:51 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2021/05/20 14:10:51 Phase context status code:  Message: 
[Container] 2021/05/20 14:10:51 Expanding base directory path: .
[Container] 2021/05/20 14:10:51 Assembling file list
[Container] 2021/05/20 14:10:51 Expanding .
[Container] 2021/05/20 14:10:51 Expanding file paths for base directory .
[Container] 2021/05/20 14:10:51 Assembling file list
[Container] 2021/05/20 14:10:51 Expanding cfStack.yml
[Container] 2021/05/20 14:10:51 Skipping invalid file path cfStack.yml
[Container] 2021/05/20 14:10:51 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2021/05/20 14:10:51 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found

我也尝试过./cfStack.yml,但没有成功。

最佳答案

看起来该文件存在于目录“Lambda”中。因此,您应该为目录名称添加前缀,如下所示。

文物: 文件: - 'Lambda/cfStack.yml'

或者您应该如下设置基本目录。

文物: 文件: - 'cfStack.yml' 基目录:'Lambda'

关于aws-cloudformation - AWS CodeBuild : Skipping invalid file path, UPLOAD_ARTIFACTS 状态:失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67624096/

相关文章:

amazon-web-services - CloudFormation Elastic 负载均衡器监听器与监听器证书的循环依赖关系

aws-cloudformation - Cloudformation 托管服务会定期重新启动,并且应用程序日志会被清除

amazon-web-services - 我可以使用 CloudFormation 模板更新 AWS Lambda 函数吗?

typescript - 我在构建 aws cdk rds **堆栈失败 : ValidationError: Given input did not match expected format 时遇到错误

docker-compose - AWS Build Project 服务 docker-compose 构建命令不起作用

aws-cloudformation - AWS CDK Assets 路径不正确

amazon-web-services - AWS CloudFormation EC2 用户数据 - 使用 "!If"

typescript - 如何通过CDK设置注册目标的端口

credentials - 在 AWS CodePipeline 中处理运行时和构建时 secret

amazon-web-services - 设置 GatewayResponse 时指定的映射表达式无效