1. 源码配置git
在 Credentials中配置 git 帐号密码(若是是Gitee 可使用 Jenkins Gitee Plugin)浏览器
2. 构建编译版本并发
2.1 批处理的目的ui
还原Nuget包(需单独安装 Nuget)spa
"C:\Program Files (x86)\Jenkins\Tool\nuget.exe" restore "C:\Program Files (x86)\Jenkins\workspace\xxxx.sln" -ConfigFile "C:\Users\xxx\AppData\Roaming\NuGet\NuGet.Config" -NoCache
2.2 MsBuild 配置插件
插件安装MSBuild 并全局变量中配置MSBuild。rest
配置 Build参数code
/t:Rebuild /p:Configuration=Release /consoleloggerparameters:ErrorsOnly /t:ResolveReferences;Compile /t:_WPPCopyWebApplication /p:Configuration=Release /p:_ResolveReferenceDependencies=true /p:WebProjectOutputDir=D:\publish\P
MSBuild Version 配置的 MSBuild.exeblog
MSBuild Build File 是须要发布项目的项目文件ci
/t:Rebuild 表示每次都重建,不使用增量编译
/P:Configuration=Release 表示编译 Release 版本
/p:DeployOnBuild=true 表示启用编译并发布 (试了下只支持文件系统发布,ftp不行) PublishProfile 指定vs建立的Profile名称。 用法: /p:DeployOnBuild=True;PublishProfile=FolderProfile
/p:VisualStudioVersion=11.0 表示VS2012,本身在vs里面看版本
/p:DefineConstants=\"ZHEJIANGSZ,SILVERLIGHT,TRACE\" 浏览器内
/p:OutputPath=D:\Jenkins\JenkinsGitTest 编译后放的位置