【问题标题】:AWS CodeBuild: Skipping invalid file path, UPLOAD_ARTIFACTS State: FAILEDAWS CodeBuild:跳过无效的文件路径,UPLOAD_ARTIFACTS 状态:FAILED
【发布时间】:2021-08-09 22:14:57
【问题描述】:

我有以下 buildspec.yml

version: 0.2
phases:
  install:
    commands:
      - npm install -g aws-cdk@1.72.0
  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 没用。

【问题讨论】:

  • ls 的输出是什么?
  • [Container] 2021/05/20 14:10:51 Running command ls NetworkRailGateway-Functions README.md RealtimeStations-Functions cdk.context.json cdk.json cdk.out cfStack.yml src

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


【解决方案1】:

看起来该文件存在于目录“Lambda”中。所以你应该在下面的目录名称前加上前缀。

神器: 文件: - 'Lambda/cfStack.yml'

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

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

【讨论】:

    猜你喜欢
    • 2018-07-23
    • 2022-01-13
    • 2021-05-08
    • 2015-08-24
    • 1970-01-01
    • 2017-05-28
    • 2019-06-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多