On the installation and configuration of the automation integrated environment under the. NET Jenkins SVN

Source: Internet
Author: User
Tags svn

I have been doing. NET research and development for more than 3 years, has been biased towards technical research, I learned a lot of technology, and now suddenly found that learning so much technology what is the use? There's really not much to be used.

Right now? A little bird, self-deprecating ... After all, I am, many leaders have no trust in the word, I believe many small partners have this experience. So in the development, I can use only about 20% of the strength, are written in peacetime to write the code to vomit (many of the company's architecture rotten to the full, they are not the pursuit of technology but business), occasionally give advice, but also be spurned. Oh.....

Jenkins is one example, the current new version of the test phase, a day to pack n times, each test let packaging, I feel the egg hurts, said I came to build the Jenkins platform, let the test need to publish the release or incremental release, the results are ... You know.

  

Well, don't say so much, go to the point, wrong points, we share together, study together :

First, you have to download the jenkins:https://jenkins-ci.org/content/thank-you-downloading-windows-installer/installation,

Once the installation is complete, it will open the management page of Jenkins itself, the port default is 8080 (need to modify the port number in the Jenkins installation root jenkins.xml), OK, continue, we choose System Management-management plug-in,

At this time your interface may not have so many plug-ins optional, (updatable, optional plug-ins, installed, advanced) all click to find immediately get click, brush the page to wait ing ..... Okay, like:

Then find the MSBuild Pluginin the optional plug-in, click on the direct install, when the Auto build plugin is installed, in fact, call vs command line Build Platform MSBuild, if you want to publish plug-ins (according to individual needs, The previous plug-in is the SVN server to generate the latest code, the plug-in is released, the simple point is to replace the manual copy file to the server) Please continue to install the Hudson Post build Task, the operation is consistent with the previous,

OK, go to system Management = System settings, click New MSBuild at the msbuild node , fill in the name and MSBuild path, the MSBuild path is generally C:\Windows\Microsoft.NET\ Framework64\v4.0.30319\msbuild.exe, self-configuring on demand. So the question is, does the server have a vs where MSBuild? In fact, the C:\Program Files (x86) \msbuild folder on the development machine is copied directly to the server, or you can choose to install them separately.

OK, save.

Next, start a new job

In the source office to choose Subversion, enter your SVN address, if you have an account password click enter credential input,

Next, configure the build:

Msbuilder Version for the previously configured MSBuild v4.0.30319

MSBuild Build file is the name of the solution or project file

Then there is the command-line argument for MSBuild.

/t:rebuild means rebuilding every time, not using incremental compilation

/property:configuration=release represents the release version of the compilation,

/property:targetframeworkversion=v4.5 indicates that the target of the compilation is. NET 4.5 version

We build the test first, and we don't want to test it.

After completion, in the console output can be seen in the build situation,

Here I encountered a problem, has been generated failure, VS can be generated normally, here is an error, because one of the references in one of my projects for the X86 version and the purpose of the X64 version of the inconsistency caused by, to solve the problem or in the project properties = = Generated Release's build serialization assembly set to Off

Resolve error, 0 errors succeeded .....

To continue, we will then configure the job to configure the post-build operation (what needs to be done after the build is successful):

\b0\s+ (Error) is a regular retrieval of 0 errors

After retrieving 0 errors, execute the F:\Test\xxxxx\Build.bat batch file, where we place the bat file in the Server Jenkins installation directory =>workspace=>test (Jenkins job name), Or simply upload the bat file to the SVN server and put it together with the solution file)

BUILD.bat files, according to their own actual writing,

What I'm actually doing here is the generated file where the bat file is located in the drive letter/textweb/web, which is worth noting that the editor customization is required, that is, adding name= in Bbbbbbbbbbb.csproj " Target node of Publishtofilesystem "

@echo OFFCD %~dp0%windir%\microsoft.net\framework\v4.0.30319\msbuild.exe ". \aaaaaaaaaa.sln"/m/t:clean; Build/p:configuration=release/Distributedfileloggerif%errorlevel% NEQ 0 echo solution compile Failedif% errorlevel% NEQ 0 goto Endecho Compile is successful, starting Deployecho 1.  deleting textweb directoryrd/s/q Textwebecho 2.  Deploying file to Textweb Directory%windir%\microsoft.net\framework\v4.0.30319\msbuild.exe ". \path\ Bbbbbbbbbbb.csproj "/t:publishtofilesystem/p:configuration=release; Publishdir= ". \textweb\web "/Distributedfileloggerif%errorlevel% NEQ 0 echo Client deploy failedif%errorlevel% NEQ 0 goto END: ENDif%errorlevel% NEQ 0 (if "%autobuild%" EQU "1" (exit/b%errorlevel%) pause) /c0>

  <target name= "Publishtofilesystem" dependsontargets= "Pipelinepredeploycopyallfilestoonefolder" > <Error    Condition= "' $ (publishdir) ' = = '" "text=" the PublishDir property must is set to the intended publishing destination. "/> <makedir condition= "! Exists ($ (PublishDir)) "directories=" $ (publishdir) "/> <!--http://msdn.microsoft.com/en-us/library/ 3e54c37h--> <ItemGroup> <publishfiles include= "$ (_packagetempdir) \**\*.*"/> <!--Dlls in Li b folder, ADMINBLL, BLL, BLL Config, Custom component service, repositories--> <!--<dllfiles include= "$ (MSBU Ildprojectdirectory) \. \lib\**\*.*;$ (msbuildprojectdirectory) \bin\*bll.dll*.* "/>--> </ItemGroup> <copy sourcefiles=" @ ( Publishfiles) "destinationfiles=" @ (publishfiles-> ' $ (publishdir) \% (recursivedir)% (Filename)% (Extension) ') " Skipunchangedfiles= "false"/> <!--<copy sourcefiles= "@ (dllfiles)" destinationfiles= "@ (dllfiles-> ' $ ( PublishDir) \bin\% (RecUrsivedir)% (Filename)% (Extension) ' skipunchangedfiles= "false"/>--> </Target> 

Done! Enjoy it ~ You can configure the publish failed message to be sent in Jenkins, add some users to maintain, and so on as required.

On the installation and configuration of the automation integrated environment under the. NET Jenkins SVN

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.