我有以下 buildspec.yml
version: 0.2
phases:
install:
commands:
- npm install -g <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c7a6b0b4eaa4a3ac87f6e9f0f5e9f7" rel="noreferrer noopener nofollow">[email protected]</a>
build:
commands:
- cd Lambda
- cd NetworkRailGateway-Functions
- for d in ./*/; do (npm install --only=prod); done
- cd ..
- cd RealtimeStations-Functions
- for d in ./*/; do (npm install --only=prod); done
- cd ..
- cdk synth > cfStack.yml
- ls
- pwd
artifacts:
files:
- cfStack.yml
ls 命令显示 cfStack.yml 文件存在于当前目录中,但是,我确实收到以下工件错误,这似乎意味着该文件不存在
[Container] 2021/05/20 14:10:51 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2021/05/20 14:10:51 Phase context status code: Message:
[Container] 2021/05/20 14:10:51 Expanding base directory path: .
[Container] 2021/05/20 14:10:51 Assembling file list
[Container] 2021/05/20 14:10:51 Expanding .
[Container] 2021/05/20 14:10:51 Expanding file paths for base directory .
[Container] 2021/05/20 14:10:51 Assembling file list
[Container] 2021/05/20 14:10:51 Expanding cfStack.yml
[Container] 2021/05/20 14:10:51 Skipping invalid file path cfStack.yml
[Container] 2021/05/20 14:10:51 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2021/05/20 14:10:51 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found
我也尝试过./cfStack.yml,但没有成功。
最佳答案
看起来该文件存在于目录“Lambda”中。因此,您应该为目录名称添加前缀,如下所示。
文物: 文件: - 'Lambda/cfStack.yml'
或者您应该如下设置基本目录。
文物: 文件: - 'cfStack.yml' 基目录:'Lambda'
关于aws-cloudformation - AWS CodeBuild : Skipping invalid file path, UPLOAD_ARTIFACTS 状态:失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67624096/