Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple skips in MSDeploy?

Tags:

msdeploy

I'm aware of the -skip parameter, but is there any way to tell MSDeploy to skip multiple directories? Invoking the parameter multiple times does not appear to work.

like image 797
Troy Avatar asked Nov 03 '10 14:11

Troy


2 Answers

If you have the following files in the folder C:\Data\Personal\My Repo\MSDeploy\MultiSkip. alt text

To sync source to dest the command would be:

msdeploy -verb:sync 
    -source:contentPath="C:\Data\Personal\My Repo\MSDeploy\MultiSkip\Source" 
    -dest:contentPath="C:\Data\Personal\My Repo\MSDeploy\MultiSkip\Dest"

The changes are show in figure below. alt text

With no skips there are 19 changes.

Skip 1 folder

Then the command to skip the sub03 directory would be:

msdeploy -verb:sync 
    -source:contentPath="C:\Data\Personal\My Repo\MSDeploy\MultiSkip\Source" 
    -dest:contentPath="C:\Data\Personal\My Repo\MSDeploy\MultiSkip\Dest" 
    -skip:objectName=dirPath,absolutePath="sub03"

The result would be:

alt text

So there are 14 added files.

Skip 2 directories

To skip 2 directories the command would be

msdeploy -verb:sync 
    -source:contentPath="C:\Data\Personal\My Repo\MSDeploy\MultiSkip\Source" 
    -dest:contentPath="C:\Data\Personal\My Repo\MSDeploy\MultiSkip\Dest" 
    -skip:objectName=dirPath,absolutePath="sub03" 
    -skip:objectName=dirPath,absolutePath="sub02"

Then the result of that is alt text There are only 9 changes here so we can see that multiple skips does work.

like image 168
Sayed Ibrahim Hashimi Avatar answered Nov 13 '22 00:11

Sayed Ibrahim Hashimi


The skip:objectName=dirPath,absolutePath= accepts a regular expression, therefore you can achieve the same result as the answer above using:

-skip:objectName=dirPath,absolutePath="sub02|sub03"

The pipe | indicating OR

like image 30
Rots Avatar answered Nov 13 '22 02:11

Rots