gpt4 book ai didi

amazon-web-services - AWS 代码构建 - S3 存储桶中未生成报告

转载 作者:行者123 更新时间:2023-12-04 08:15:58 25 4
gpt4 key购买 nike

我正在尝试在 aws 中创建一个代码构建项目。我已经成功配置了代码构建项目并且代码也在构建中,但是没有在指定的 S3 存储桶中创建测试报告,我已经在 buildspec.yml 中指定了人工制品,但仍然没有生成报告。下面是我的 buildspec.yml文件。

version: 0.1
phases:
install:
commands:
- echo Logging in to Amazon ECR...
- npm install
pre_build:
commands:
- echo nothing to do in pre-build
build:
commands:
- echo Build started on `date`
- echo Building the Server ...
- npm test
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- buildreport.txt
discard-paths: yes

我还在 S3 Bucket 上指定了适当的权限来上传/创建文件。以下是我在成功构建后获得的构建日志 -
[Container] 2017/03/09 17:02:01 Phase context status code: Message: 
[Container] 2017/03/09 17:02:01 Entering phase POST_BUILD
[Container] 2017/03/09 17:02:01 Running command echo Build completed on `date`
[Container] 2017/03/09 17:02:01 Build completed on Thu Mar 9 17:02:01 UTC 2017
[Container] 2017/03/09 17:02:01 Running command echo $CODEBUILD_SRC_DIR
[Container] 2017/03/09 17:02:01 /tmp/src021393076/src
[Container] 2017/03/09 17:02:01 Phase complete: POST_BUILD Success: true
[Container] 2017/03/09 17:02:01 Phase context status code: Message:
[Container] 2017/03/09 17:02:01 Preparing to copy artifacts
[Container] 2017/03/09 17:02:01 Expanding base directory path
[Container] 2017/03/09 17:02:01 Assembling file list
[Container] 2017/03/09 17:02:01 Expanding .
[Container] 2017/03/09 17:02:01 Found .
[Container] 2017/03/09 17:02:01 Expanding artifact file paths for base directory .
[Container] 2017/03/09 17:02:01 Assembling file list
[Container] 2017/03/09 17:02:01 Expanding my-build
[Container] 2017/03/09 17:02:01 Skipping invalid artifact path my-build
[Container] 2017/03/09 17:02:01 Phase complete: UPLOAD_ARTIFACTS Success: false
[Container] 2017/03/09 17:02:01 Phase context status code: ARTIFACT_ERROR Message: No matching artifact paths found
[Container] 2017/03/09 17:02:01 Runtime error (No matching artifact paths found)

我在对齐和更改 buildspec.yml 后再次尝试略如下 -
version: 0.1

phases:
install:
commands:
- echo Logging in to Amazon ECR...
- npm install
pre_build:
commands:
- echo nothing to do in pre-build
build:
commands:
- echo Build started on `date`
- echo Building the Server ...
- npm test
post_build:
commands:
- echo Build completed on `date`
- echo $CODEBUILD_SRC_DIR
artifacts:
files:
- my-build

但它仍然无法在 s3 文件夹中生成人工制品。

最佳答案

我也有这个问题。关键是我必须在工件文件中指定完整路径以及文件名,工件在构建后放置。放置我的构建规范文件。

 version: 0.2

phases:
install:
runtime-versions:
java: openjdk8
pre_build:
commands:
- echo nothing here
build:
commands:
- mvn install
post_build:
commands:
- echo build completed
artifacts:
files:
- /root/.m2/repository/com/fun/learning/MyApplication/0.0.1-SNAPSHOT/MyApplication-0.0.1-SNAPSHOT.jar
cache:
paths:
-'root/.m2/**/*'

关于amazon-web-services - AWS 代码构建 - S3 存储桶中未生成报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42545793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com