Reputation: 63
I have the following buildspec.yml
version: 0.2
phases:
install:
commands:
- npm install -g [email protected]
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
The ls command is showing the cfStack.yml file is present in the current directory, however, I do get the following artifact error which seems to imply that the file does not exist
[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
I have also tried ./cfStack.yml to no avail.
Upvotes: 0
Views: 5488
Reputation: 608
It looks the file is present inside the directory 'Lambda'. So you should prefix the direcotry name as below.
artifacts: files: - 'Lambda/cfStack.yml'
Or you should set the base directory as below.
artifacts: files: - 'cfStack.yml' base-directory: 'Lambda'
Upvotes: 2