0

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.

2
  • What is the output of ls? Commented May 20, 2021 at 16:07
  • [Container] 2021/05/20 14:10:51 Running command ls NetworkRailGateway-Functions README.md RealtimeStations-Functions cdk.context.json cdk.json cdk.out cfStack.yml src Commented May 20, 2021 at 16:10

1 Answer 1

2

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'

Sign up to request clarification or add additional context in comments.

1 Comment

The file is in the current directory and shows up in ls output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.