AWS CodeBuild local cache failing to actually cache?

后端 未结 2 1831
攒了一身酷
攒了一身酷 2021-01-04 05:26

I\'ve been trying to get AWS CodeBuild\'s local cache to work and for the life of me I can\'t get even the most basic cache to work. My ultimate goal is to cache Gradle arti

2条回答
  •  庸人自扰
    2021-01-04 05:37

    The documentation isn't exactly clear, but AWS CodeBuild Local cache can only cache directories (as of time of writing). This is slightly confusing because the AWS CodeBuild buildspec specification allows the path to be individual files or a wildcard, but in reality specifying a file will yield an error.

    Unable to initialize cache download: only directories can be cached locally: ...
    

    In your example you use specify the cache as

    cache:
      paths:
        - '/root/foo/*'
    

    Where * would refer to all individual files and folders inside foo but only folders would be cached.

    Specifying the entire directory should work

    cache:
      paths:
        - /root/foo/
    

提交回复
热议问题