Jenkins 集成 git .net 和nuget
1. 源碼配置

在 Credentials中配置 git 賬號密碼(如果是Gitee 可以使用 Jenkins Gitee Plugin)
2. 構建編譯版本

2.1 批處理的目的
還原Nuget包(需單獨安裝 Nuget)
"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。
配置 Build參數
/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.exe
MSBuild Build File 是需要發布項目的項目文件
/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 編譯后放的位置

浙公網安備 33010602011771號