我正在尝试使用CodePipeLine和CodeBuild for .Net Core项目在AWS中实现CI / CD管道。
该构建已成功执行,但是在上传工件时出现以下错误。
这可能与路径问题有关,尝试以其他方式更改路径,但仍然会收到错误。
Buildspec.yml文件
version: 0.2
phases:
pre_build:
commands:
- echo Restore started on `date`
- dotnet restore MVCApplication/MVCApplication.csproj
build:
commands:
- echo Build started on `date`
- dotnet publish -c release -o ./build_output MVCApplication/MVCApplication.csproj
artifacts:
files:
- MVCApplication/build_output/**/*
- scripts/**/*
错误日志
[Container] 2020/04/06 15:22:42 Expanding base directory path: .
[Container] 2020/04/06 15:22:45 Assembling file list
[Container] 2020/04/06 15:22:45 Expanding .
[Container] 2020/04/06 15:22:48 Expanding file paths for base directory .
[Container] 2020/04/06 15:22:48 Assembling file list
[Container] 2020/04/06 15:22:48 Expanding MVCApplication/build_output/**/*
[Container] 2020/04/06 15:22:52 Expanding scripts/**/*
[Container] 2020/04/06 15:22:55 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2020/04/06 15:22:55 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found
我尝试了其他方法,但似乎没有用。谁能告诉我我在哪里做错了吗?
对此有任何帮助!
答案 0 :(得分:1)
在“构建”阶段中,将以下命令作为最后一个命令运行,以确认您要人工构建的文件存在:
- pwd
- tree /F
第二,尝试如下更改工件部分(使用Windows样式路径)
artifacts:
files:
- .\MVCApplication\build_output\*
- .\scripts\*
https://docs.aws.amazon.com/codebuild/latest/userguide/sample-windows.html
答案 1 :(得分:0)
我尝试通过在buildspec文件中进行以下更改来解决错误。对我来说很好。
version: 0.2
phases:
pre_build:
commands:
- echo Restore started on `date`
- dotnet restore MVCApplication/MVCApplication.csproj
build:
commands:
- echo Build started on `date`
- dotnet publish -c release -o ./build_output MVCApplication/MVCApplication.csproj
- 'dir ./build_output'
artifacts:
files:
- '**/*'
base-directory: '../src/build_output'