Do AWS CodeBuild cache paths support "!" wildcard?


I'm struggling to use CodeBuild cache in my project with Yarn Workspace as I mentioned

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

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


    - '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/!(@packages|@projects): symlink /codebuild/local-cache/custom/eb9bb0b44747dafd702a8f2ed727c6d71eeb4d132e693b9d70d767d72cd9775c/node_modules/!(@packages|@projects) /codebuild/output/src639680001/src/!(@packages|@projects): no such file or directory **

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

asked 5 years ago363 views
1 Answer

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