I'd like to exclude node_modules folder from deleting, but it removes all workspace. I've already tried a lot of patterns with 'Apply pattern also on directories' option and without it.
Some of them: **/node_modules/**, */node_modules/*
I also found an issue https://issues.jenkins-ci.org/browse/JENKINS-12783,
but seams like I'm trying to use wrong pattern.
Sorry for the extra answer but nightmare's didn't get me all the way to the final result. Because of JENKINS-1278, if you want to exclude node_modules
directories that are in child directories of the parent you have to exclude both the .git directories and the parent directory itself.
So let's say you have a directory layout like:
subModule1/
node_modules/
...
subModule2/
node_modules/
...
In this case you'll need to exclude the following directories:
**/.git/**
**/node_modules/**
subModule1
subModule2
If you do that, then everything inside of subModule1 and subModule2 will still get deleted (except the node_modules directory, of course). And Git will still get updated with the latest changes even though it's not completely blown away each time.
It works for me, and I do not have "Apply pattern also on directories" checked. It seems like that should be checked but according to that bug report you need to leave it unchecked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With