msdeploy 远程发布到lls
一、bat配置
cd MOC.HRManagement.Weixin.Front nvm use 8.11.0 npm config set registry http://mirrors.shanghai-electric.com:8081/nexus/repository/npm-group/ npm run builduat set b=%cd% "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:contentpath=E:\jenkins\workspace\HRSSCWX_FRONTEND\MOC.HRManagement.Weixin.Front\dist\ -dest:contentpath=C:\Jenkins_Publish\test\test2,computername=10.0.11.95,username=ad01\用户名,password=******** -enableRule:DoNotDeleteRule
二、发布前先执行powershell命令备份
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -skip:absolutePath=vendors.979307d8.chunk.css -preSync:runCommand="C:\Windows\System32\WindowsPowerShell\v1.0\powershell C:\Jenkins_Publish\back.ps1 ", -source:contentpath=E:\jenkins\workspace\PRD_SPFA\MOC.HR\MOC.OA.Web -dest:contentpath=C:\Jenkins_Publish\SPFA,computername=%TP%,username=ad01\DCxxxxxxxxx,password=xxxxxxxx -enableRule:DoNotDeleteRule -allowUntrusted=true -postSync:runCommand="C:\Windows\System32\inetsrv\appcmd.exe start apppool /apppool.name:SPFA"
-skip:absolutePath=vendors.979307d8.chunk.css 保留这个文件不替换更新,默认是自动更新所有文件。
-enableRule:DoNotDeleteRule -allowUntrusted=true 不删除多于的文件,文件数量自动增加