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 编译后放的位置

 

posted @ 2019-04-25 16:40  Shikyoh  阅读(512)  评论(0编辑  收藏  举报