Do AWS CodeBuild cache paths support "!" wildcard?

0

I'm struggling to use CodeBuild cache in my project with Yarn Workspace as I mentioned https://stackoverflow.com/questions/55890275/aws-codebuild-does-not-work-with-yarn-workspaces.

I'd like to know if cache paths support "!" wildcard. I've tried to set paths this way

cache:
  paths:
    - 'node_modules/!(@packages|@projects)/*'

instead

cache:
  paths:
    - 'node_modules/**/*'

because this way I'd be able to manually exclude the folders that Yarn creates, thus removing the error, and consider the others. Unfortunately, I got this error

** 2019/05/01 16:38:12 Error mounting /codebuild/output/src639680001/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/MY_REPOSITORY/node_modules/!(@packages|@projects): symlink /codebuild/local-cache/custom/eb9bb0b44747dafd702a8f2ed727c6d71eeb4d132e693b9d70d767d72cd9775c/node_modules/!(@packages|@projects) /codebuild/output/src639680001/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/MY_REPOSITORY/node_modules/!(@packages|@projects): no such file or directory **

Is there a correct manner to use "!" wildcard?

asked 5 years ago329 views
1 Answer
0

Hi arantespp,

CodeBuild's cache syntax currently only supports inclusive (as opposed to exclusive) notation. We'll look into the possibility of expanding this feature in future.

For right now, you can run rm -r node_modules/@packages node_modules/@projects at the beginning of your build if you do not want those directories to remain in the cache.

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions