首页 > 解决方案 > CodeBuild 成功,但 CodeDeploy 失败

问题描述

Codebuild 成功完成,但 CodeDeploy 失败。检查错误消息指出“操作失败,因为找不到工件或 Amazon S3 存储桶。” 检查代码管道存储桶后,我在那里看到了输入工件,但没有看到输出工件。这是我用于 buildspec.yml 的代码:

version: 0.2
phases:
  pre_build:
    commands:
    - echo "Entered the pre-build phase"
  build:
    commands:
    - echo "Entered build phase"
    - mvn package
    - ls
    - (cd target && ls)
    - (cd target/ROOT && ls)
    
  post_build:
    commands:
    - echo "Entered the post-build phase"
    artifacts:
      files:
        - '**/*'

标签: aws-codepipelineaws-codebuild

解决方案


请按如下方式更正工件缩进:

version: 0.2
phases:
  pre_build:
    commands:
    - echo "Entered the pre-build phase"
  build:
    commands:
    - echo "Entered build phase"
    - mvn package
    - ls
    - (cd target && ls)
    - (cd target/ROOT && ls)

  post_build:
    commands:
    - echo "Entered the post-build phase"
artifacts:
  files:
    - '**/*'

推荐阅读