Drillster / drone-volume-cache

Drone plugin for caching to a locally mounted volume
MIT License
109 stars 42 forks source link

Clear Cache on Specific File Changes #14

Closed sedouard closed 6 years ago

sedouard commented 6 years ago

I've been noticing NPM errors due to the cache restore like so:

npm WARN EPACKAGEJSON api@1.1.0 No repository field.
27s
1812
npm WARN EPACKAGEJSON api@1.1.0 No license field.
27s
1813
npm ERR! Linux 4.4.0-92-generic
27s
1814
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
27s
1815
npm ERR! node v5.5.0
27s
1816
npm ERR! npm  v3.3.12
27s
1817
npm ERR! path /drone/src/github.com/vmpowerio/api/node_modules/aws-sdk/node_modules/.bin/uuid
27s
1818
npm ERR! code EEXIST
27s
1820
npm ERR! Refusing to delete: /drone/src/github.com/vmpowerio/api/node_modules/aws-sdk/node_modules/.bin/uuid not in /drone/src/github.com/vmpowerio/api/node_modules/aws-sdk/node_modules/uuid
27s
1821
File exists: /drone/src/github.com/vmpowerio/api/node_modules/aws-sdk/node_modules/.bin/uuid
27s
1822
Move it away, and try again. 

I suspect this occurs after I make changes to package.json. Do you think it is feasible to trigger a cache clear if a certain file exists in the commit changeset that triggered the build?

mjwwit commented 6 years ago

This is an interesting error. I haven't run into anything like this before, and I've been using Drone to build Node.js projects for a long time. Either way, it's super complex to clear cache based on a change set. Generally speaking Drone only checks out the head version for performance. This means this plugin does not have reliable access to the Git history.

These issues really shouldn't occur if you're just caching your node_modules folder. I think you'll have to look for the issue in your project setup.

mjwwit commented 6 years ago

I'm closing this because it's most likely a project setup issue.