Uploading Artifacts Only From Specific Folder AWS CodeBuild

Viewed 98

I have a working AWS CodeBuild project with the following command

version: 0.2
phases:
  install:
    runtime-versions:
      dotnet: 6.0
      # name: version  
  build:
    commands:
      - dotnet publish SourceCode/API/PPMT-BACKEND.csproj
artifacts:
  files:   
    - '**/*'

When the build is finished, i check my s3 bucket for the artifact and i get the whole repo in a .zip, when i unzip the artifact, i find the artifacts that i want under SourceCode\API\bin\Debug\net6.0\publish\

But when i changed the artifacts block to

artifacts:
  files:
    - '**/*'
  base-directory: 'SourceCode\API\bin\Debug\net6.0\publish\'
  discard-paths: yes

i get these errors

[Container] 2022/07/13 16:36:17 Expanding base directory path: SourceCode\API\bin\Debug\net6.0\publish\
[Container] 2022/07/13 16:36:17 Assembling file list
[Container] 2022/07/13 16:36:17 Expanding SourceCode\API\bin\Debug\net6.0\publish\
[Container] 2022/07/13 16:36:17 Skipping invalid file path SourceCode\API\bin\Debug\net6.0\publish\
[Container] 2022/07/13 16:36:17 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2022/07/13 16:36:17 Phase context status code: CLIENT_ERROR Message: no matching base directory path found for SourceCode\API\bin\Debug\net6.0\publish\

how do i only get the artifacts that are inside the publish folder and zipped?

Thanks in advance

0 Answers
Related