zoukankan      html  css  js  c++  java
  • 用【Jenkins】搭建.NET自动编译测试与发布环境

    本示例在Windows操作系统下搭建,前提条件是已安装.NET Framework.

    1. 从 https://jenkins.io/download/下载Jenkins的Windows安装包。

    2.安装好后浏览器访问 http://localhost:8080

    3.配置编译和测试插件,通过点击 Jenkins -> 系统管理 -> 管理插件 打开如下页面在可选插件选项卡下选中:

     然后点击直接安装。

    4. 配置MSBuild的路径,通过点击 Jenkins -> 系统管理 -> 全局工具配置,找到MSBuild 配置节:

    输入MSBuild在服务器上的安装路径,如: C:WindowsMicrosoft.NETFramework64v4.0.30319MSBuild.exe 

    完成点击Save。

    如果编译的机器上没有安装Visual Studio, 在编译的过程中可能会引发MSB4019错误:

    error MSB4019: The imported project "C:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0WebApplicationsMicrosoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    对于这种情况,可以将开发机上的C:Program Files (x86)MSBuild文件夹之间拷贝到编译机上。

    5.新建一个任务

    6.在源码管理 节配置Git源码库存放的路径:

    7. 在 构建 节配置MSBuild相关的内容:

    MSBuilder Version 为之前配置的 "Version 4.0"

    MSBuild Build File 是项目文件或者工程文件的名称

    MSBuild的命令行参数:

    /t:Rebuild 表示每次都重建,不使用增量编译

    /property:Configuration=Release 表示编译Release版本,

    /property:TargetFrameworkVersion=v4.6.1 表示编译的目标是.NET 4.6.1

    保存后,点击左侧 立即构建 开始测试一次编译。

    如果编译过程中出现错误,需查看Console Output.

     *****************************
     *** Keep learning and growing. ***
     *****************************
  • 相关阅读:
    ubuntu16.04安装ibus中文输入法
    apt --fix-broken install
    fuelgauge
    make flash FLASH_CONFIG=jtag_full
    使用android ndk编译boost动态库
    RK3288的gpio设置
    RK3288 GPIO 输出问题
    HDU-2586-裸LCA入门-tarjan离线
    uva-11324-SCC+dp
    HDU-2767-tarjan/Kosaraju求scc
  • 原文地址:https://www.cnblogs.com/gangle/p/9352972.html
Copyright © 2011-2022 走看看