我想在aws中創建一個代碼生成項目。我已成功配置了代碼構建項目,並且代碼也正在構建,但是測試報告沒有在指定的S3存儲桶中創建,我已經在buildspec.yml中指定了這些構件,但仍未生成報告。以下是我的buildspec.yml
文件。AWS Code Build - 在S3 Bucket中沒有生成報告
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文物夾。
你有沒有找到解決方案? – Justin
不,我不能不管我在文件參數中設置的工件,它不起作用。這迫使我切換到詹金斯。 – Jeet