Jenkins continues to integrate on the Windows system dotnet Platform

Source: Internet
Author: User
Tags dotnet git client ruby on rails

Before writing an article that builds the. NET Automation compilation environment on CentOS, today this is the environment for the Windows platform.

Jenkins is an open source software project designed to provide an open and easy-to-use software platform that makes continuous software integration possible. Jenkins is a continuous integration tool based on Java development that monitors continuous duplication of work,

Jenkins was developed by Sun's former employees and is rooted in Java, but can also be used in non-Java projects such as PHP, Ruby on Rails,. NET. There are many tools involved in continuous integration. It provides a web interface that users can use in the interface

On the configuration job, each job contains a series of build steps. Jenkins can do all the validation work mentioned in the beginning of the scenario, and it can further automate deployment or one-click Deployment.

Let's get started, Environment Windows Server 2012

1. Install Jenkins

Http://ftp-nyc.osuosl.org/pub/jenkins/windows/jenkins-1.629.zip

2. Install MsBuild, Git Plugin for Jenkins

GIT Client Plugin

Shared Library plugin for other Git related Jenkins plugins.

GIT Plugin

This plugin integrates GIT with Jenkins.

MSBuild Plugin

This plugin makes it possible to build a Visual Studio project (. proj) and solution files (. sln).

SCM API Plugin

This plugin provides a new enhanced API for interacting with SCM systems.

Credentials Plugin

This plugin allows the store credentials in Jenkins.

The plugin can be found here Https://wiki.jenkins-ci.org/display/JENKINS/Plugins

3. Install Git

Download and install Http://www.git-scm.com/downloads from official website

4. Install the. NET Framework 4.5.2

Official website Download Install http://www.microsoft.com/en-us/download/details.aspx?id=42642

5. Install Microsoft Build Tools 2013

Official website Download Install http://www.microsoft.com/en-us/download/details.aspx?id=40760

6. Assuming that VS2013 is installed locally, copy the local C:\Program files (x86) \msbuild\microsoft all files to the same location on the server

The author is to see that these files

Packages are placed on the server with the corresponding path.

7. Install Web Deploy v3.0

Official website Download Install Http://www.iis.net/downloads/microsoft/web-deploy

8. Install Artifact Deployer Plugin

This artifact allows-choose which directories you'll like-to-deploy to the target destination

Https://wiki.jenkins-ci.org/display/JENKINS/ArtifactDeployer+Plugin

System Configuration for Jenkins

Git configuration

MSBuild configuration

Mail

Other questions 1. Compile-time conversion Web. config file

For example, we need to replace the Web error display mechanism in release mode, the database connection string, the log file output level, or the directory configuration can be.

If you add the following XML to the bottom of the. csproj file for your Web application, you'll ensure that the config tra Nsformation occurs before every build:

<import project= "$ (MSBuildExtensionsPath32) \microsoft\visualstudio\v10.0\webapplications\ Microsoft.WebApplication.targets "/><target name=" BeforeBuild "><transformxml source=" Web.Base.config " Transform= "web.$ (Configuration). config" destination= "Web. config"/></target>

Edit: In response to your comment, you should is able to use Web. config as the source parameter in the TransformXML task (see St EP #2). If you have want to perform the config transform in the build script, follow these instructions:

1) Import Webapplication.targets in your build script like so:

<import project= "$ (MSBuildExtensionsPath32) \microsoft\visualstudio\v10.0\webapplications\ Microsoft.WebApplication.targets "/>

2) Execute The TransformXML build task in your build script target:

<target name= "Mybuildscripttarget" ><transformxml source= "Web. config" transform= "web.$ (Configuration). Config "destination=" Web. config "/>...other build tasks...</target>

Convert Nlog.config, you can also refer to Web. config, implement NLog.Debug.config and Nlog.Release.config, the following example NLog.Release.config file:

<?xml version= "1.0" encoding= "Utf-8"? ><nlog xmlns= "Http://www.nlog-project.org/schemas/NLog.xsd"  Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:xdt= "http://schemas.microsoft.com/ Xml-document-transform ">  <targets async=" true ">    <target xdt:transform=" Insert "  name=" Elastic "xsi:type=" ElasticSearch "uri=" Http://10.1.101.54:9200/"index=" Webappinit "documenttype=" LogEvent "  >      <field name= "Logger" layout= "${logger}" layouttype= "System.String"/>    </target>  </ targets>  <rules>    <logger xdt:transform= "Insert" name= "*" minlevel= "Trace" writeto= "elastic"/ >  </rules></nlog>
Above we have added the Nlog output to the Elasticsearch configuration section in release mode. 2. microsoft.build.tasks.v4.0 compilation Problem Build Failure issue:

Could not being loaded from the assembly "C:\Program Files (x86) \msbuild\12.0\bin\amd64\microsoft.build.tasks.v4.0.dll". Could not load file or assembly ' File:///c:\program Files (x86) \msbuild\12.0\bin\amd64\microsoft.build.tasks.v4.0.dll

Ideally should be doing the following:

1) Open your nuget.targets file:c:\builds\1\xxxx\ftp Processor (New) \src.nuget\nuget.targets

2) Identify The task referencing the old DLL.

<usingtask assemblyfile= "$ (MSBuildToolsPath) \microsoft.build.tasks.v4.0.dll" taskfactory= "CodeTaskFactory" >

...

3) Then the future of proof it like so:

<usingtask assemblyfile= "$ (MSBuildToolsPath) \microsoft.build.tasks.v$ (msbuildtoolsversion). dll" TaskFactory= " Codetaskfactory ">

...

3. Git Chinese garbled problem

Go to git installation directory, change the configuration can be basically resolved:

Etc\gitconfig:

[GUI]     encoding = utf-8[i18n]     commitencoding = gbk[svn]     pathnameencoding = GBK

Description: Opens Chinese support in a Git environment. Pathnameencoding set the file path for Chinese support.

4. Information

Official website: http://jenkins-ci.org/

Source code: Https://github.com/kohsuke/hudson

Summarize


Continuous Integration is a software development practice in which team development members often integrate their work, with each member being integrated at least once a day, which means that multiple integrations may occur on a daily basis. Each integration is validated through automated builds, including compilation, release, and automated testing, to identify integration errors early. The process of integrating software is not a new problem, and if the size of the project is small, such as a person's project, if it is less dependent on the external system, then software integration is not a problem, but as the complexity of the software project increases (even if one person is added), There are additional requirements for integrating and ensuring that software components work together-early integration and often integration. Early integration, frequent integration helps projects identify project risks and quality issues early on, and if these problems are discovered later on, it can be costly to solve the problem, potentially leading to project delays or project failures.
This article briefly introduces the concept of continuous integration and highlights how to quickly build a continuous integration environment based on Jenkins. Through the description of concrete examples, I believe readers have a clearer understanding and understanding of Jenkins ' basic functions and methods of realization. In fact, Jenkins's functionality is far from what is described in this article, and Jenkins also features detailed log processing and analysis of continuous integration build status. We hope to share with you in further study and application.

Hope to your enterprise application development and Enterprise Informatization Help. Other articles you might be interested in:

Build the. NET Automation compilation environment on CentOS
Jenkins Knowledge Map
Specialization in software development
IT Infrastructure planning scenario one (network system planning)
IT Infrastructure Planning Program II (computer system and computer room planning and planning)
IT Infrastructure Planning Scenario III (IT Infrastructure software and system planning)
Evolution of real-time measurement system of enterprise application performance
A few examples of cloud computing reference architectures
Smart Mobile Guide Solution Brief
Evolution of human resource management system

If you want to know more software development, system it integration, enterprise information and other information, please follow my subscription number:


Petter Liu
Source: http://www.cnblogs.com/wintersun/
This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.
The article was also published in my Independent blog-petter Liu blog.

Jenkins continues to integrate on the Windows system dotnet Platform

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.