Jenkins 集成 git .net 和nuget

 

 

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 編譯後放的位置

相關文章
相關標籤/搜索