一、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 FilesIISMicrosoft Web Deploy V3msdeploy.exe" -verb:sync -source:contentpath=E:jenkinsworkspaceHRSSCWX_FRONTENDMOC.HRManagement.Weixin.Frontdist -dest:contentpath=C:Jenkins_Publish est est2,computername=10.0.11.95,username=ad01用户名,password=******** -enableRule:DoNotDeleteRule
二、发布前先执行powershell命令备份
"C:Program FilesIISMicrosoft Web Deploy V3msdeploy.exe" -verb:sync -skip:absolutePath=vendors.979307d8.chunk.css -preSync:runCommand="C:WindowsSystem32WindowsPowerShellv1.0powershell C:Jenkins_Publishack.ps1 ", -source:contentpath=E:jenkinsworkspacePRD_SPFAMOC.HRMOC.OA.Web -dest:contentpath=C:Jenkins_PublishSPFA,computername=%TP%,username=ad01DCxxxxxxxxx,password=xxxxxxxx -enableRule:DoNotDeleteRule -allowUntrusted=true -postSync:runCommand="C:WindowsSystem32inetsrvappcmd.exe start apppool /apppool.name:SPFA"
-skip:absolutePath=vendors.979307d8.chunk.css 保留这个文件不替换更新,默认是自动更新所有文件。
-enableRule:DoNotDeleteRule -allowUntrusted=true 不删除多于的文件,文件数量自动增加