Windows Jenkins FAQ Pits

Source: Internet
Author: User
Tags node server

 There is no advanced thing, 1 2 days most people can find out for themselves, here will be the problems they have encountered to avoid other students dig the pit again.

Directory

  1. master-Slave node

2. NuGet Automatic Package Restore

3. PowerShell Deployment

4. The intranet machine realizes the change-based construction

5. GitHub private Project Pull time limit

The so-called master-slave, main application scenarios such as multiple environments (windows/linux,.net/java/php) require different building bases, and we don't want to mix a series of steps and environments on a single build server, so similar to the agent in Go, Jenkins also provides the concept of the slave node, which allows you to deploy different categories of projects on a cluster node server. The node server does not need to install the complete Jenkins package, and the distribution of build events is performed by the master side.

It is important to note that the communication between the master and slave nodes, I choose here is to start from the node as a Windows service, and I encountered the pit is the environment variable configuration problem, when I installed the JDK in the master-slave service and configure the environment variables, Found when booting from the node or how can not find the JDK, card for half an hour to find that Jenkins from the node environment variables are required in the Web system configuration, this pit filled, the latter cautious into.

As for the allocation of the slave end in the build configuration

The classmate NuGet with. NET development should be mostly involved, like the Java maven, one of the artifacts, not much to say. If you're developing with Visual Studio, there's an option here.

Check here will be in your rebuild project automatically when the lost package, of course, limited to the content of the public platform, if the students themselves developed the local version of the package will encounter another problem, here we focus on these.

Come back to Jenkins. Because the build condition of Jenkins does not currently support direct use of the. NET IDE, we need to install the MSBuild plugin

After the build is finished, the compilation fails and various components are lost. Fill in the hole here, first unload our main output item, then edit the project property content, and at the end add a node configuration

?
1234 < target name= " Afterbuild, &NBSP;&NBSP;&NBSP;&NBSP; < msbuild condition= "' $ (Configuration) |$ ( Platform) ' = = ' release|x86 ' "projects=" Nuget\nuget.msbuild "/>    </ target &NBSP;&NBSP; < import project= "$ (solutiondir) \.nuget\nuget.targets" condition= "Exists (' $ (solutiondir) \.nuget \nuget.targets ') "/>

Restore the project so that you can use the MSBuild command again to OK.

The PowerShell usage scenario can be understood so that after we build a project, we need to deploy it on a test server, but our database configuration needs to be modified, how to remove manual intervention, and we need to use PowerShell or other tools.

The use of PowerShell you can be divided into 2 kinds, one is to write the PS script and then through the batch command in the PowerShell command, the other is Jenkins directly install PowerShell command, which is more recommended, Because sometimes you don't have permissions to modify scripts or other elements on the server, all of which are more intuitive and simple, simple database connection modification scripts

?
12345 $original_file = ‘xx\web.config‘$destination_file ‘xx\web.config‘(Get-Content $original_file) | Foreach-Object {    $_ -replace ‘name="dbdemo" connectionstring=".+" ‘, ‘name="dbdemo"  connectionString="server=(local);database=basedemo;user id=demoUser;[email protected]#qqq" providerName="System.Data.SqlClient" ‘} | Set-Content $destination_file -encoding UTF8

Windows Jenkins FAQ Pits

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.