我正在尝试使用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
我尝试了其他方法,但似乎没有用。谁能让我知道我做错了吗?
对此有任何帮助!
在“构建”阶段中,作为最后一个命令运行以下命令,以确认您尝试构建工件的文件存在:
- pwd
- tree /F
第二,尝试如下更改工件部分(使用Windows样式路径)
artifacts:
files:
- .\MVCApplication\build_output\*
- .\scripts\*
https://docs.aws.amazon.com/codebuild/latest/userguide/sample-windows.html