Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

skip rules in msdeploy

I am passing several skip arguments to msdeploy in order not to synchronize(Delete and Update) some directories and files

 -skip:skipAction='Update',objectName='filePath',absolutePath='.*\\documents\\.*'

It does not seem to work, some directories and files get deleted. I am pretty sure there's no problem in the regular expression given to the absolutePath

Can anyone please clear up how the matching works for the skip rules? It is clearly not working according to the regular expression and objectName.

like image 706
WriteEatSleepRepeat Avatar asked Oct 01 '12 14:10

WriteEatSleepRepeat


1 Answers

Look here:

http://forums.iis.net/p/1192163/2031814.aspx#2031813

The way skip rules are applied is based on the order of the synchronization operation(delete, update, add) is done on the actual object(directory or file).

For example, if there's a delete operation on the directory, the skip rules for files within the directory for the delete operation will NOT PREVENT files from being get DELETED!

In my case, the directory MySite\MobileForms get deleted entirely. The skip rule I set for the files is useless.

And for the directory, my mistake is in the regular expression:

-skip:skipAction='Delete',objectName='dirPath',absolutePath='.*\\MobileForms\\.*'

Should be:

-skip:skipAction='Delete',objectName='dirPath',absolutePath='.*\\MobileForms$'

which says that it should skip deleting directory path MobileForms(the first rule erroneously included slash in the regular expression).

Hope this helps others as well.

like image 135
WriteEatSleepRepeat Avatar answered Nov 09 '22 19:11

WriteEatSleepRepeat