This series of articles contains:
[Lone solitary nine swords] continuous integration Practice (i)-Intro
[Lone solitary nine swords] continuous Integration Practice (ii) Introduction to –msbuild grammar
[Lone solitary nine swords] continuous Integration Practice (iii)-Jenkins installation and configuration (Jenkins+msbuild+github)
1, the concept of description (understand the words jump to the 2nd part) 1.1. My understanding
Continuous integration (continuous integration) to automate the phase of "from development to rollout". Of course, simple deployment is also possible, and complex involves a continuous deployment phase.
1.2, the theoretical level of the description
The following is a excerpt of each site definition:
Baidu : Continuous integration is a software development practice in which team development members often integrate their work, and each member is 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.
Sogou : Continuous integration refers to the development phase, the continuous automation of the project to compile, test, to achieve the control of code quality means. Continuous integration is a software development practice.
1.3. Application and Composition
In the agile development process, the use of continuous integration is particularly frequent. Each integration is validated through automated builds, including automated compilation, publishing, and testing, to quickly identify integration errors and enable teams to develop cohesive software faster.
Core value of 1.3.1 and continuous integration
The core value of continuous integration is:
1) Any part of continuous integration is done automatically, without too much manual intervention, which helps to reduce the duplication process to save time, expense and workload;
2) Continuous integration ensures that the code submitted by team members at each point in time can be successfully integrated. In other words, at any point in time can find the first time the integration of software issues, so that the release of deployable software at any time becomes possible;
3) Continuous integration is also beneficial to the development of the software itself, which is particularly important in scenarios where demand is unclear or frequently changed, and the quality of continuous integration helps teams make effective decisions while building team confidence in developing products.
1.3.2, the principle of continuous integration
The principles of continuous integration, which are universally recognized by the industry, include:
1) requires version control software to ensure that the code submitted by team members does not cause integration to fail. The commonly used version control software is IBM Rational ClearCase, CVS, Subversion and so on;
2) developers must submit their code to the version control repository in a timely manner, and must update the code from the version control repository regularly to the local;
3) A dedicated integration server is required to perform the integration build. Depending on the actual project, the integration build can be triggered directly by the modification of the software, or it can be started on a regular basis, such as every half hour.
4) The success of the build must be ensured. If the build fails, fixing the errors in the build process is the highest priority work. Once repaired, you need to start the build manually.
Said a lot of nonsense, now start on dry.
2. Text 2.1, the composition of continuous integration System
A complete build system must include:
1) An automated build process that includes automated compilation, distribution, deployment, and testing.
2) A code repository that requires version control software to guarantee the maintainability of the Code and as a repository for the build process.
3) a continuous integration server.
1) automatically build and 2) code repository, all have the corresponding software, developers need to learn the cost is not high, complex in each module's mutual cooperation, this period may require a lot of time to debug. Once the commissioning is complete, the productivity gains are multiplied.
2.2. MSBuild
Automated builds, and colleagues who do. NET development believe most will use VS, and Visual Studio builds. NET projects with MSBuild. What MSBuild needs is just a script that specifies the target to execute in the script; the. csproj and. vbproj files in the project are all MSBuild scripts. Once you have written your MSBuild script, you can compile and test your code with just one simple command. The basic syntax for MSBuild is described below.
[Lone solitary nine swords] continuous integration practice –MSBUILD Syntax Primer
Although MSBuild implements automatic compilation and testing, when we call MSBuild, we call through the input command, which is doped with the components of the manual intervention, so we want to eliminate this part of the work.
2.3. Version Management
At present the mainstream version management has the traditional SVN, the distributed git and the Mercurail each has the pros and cons, chooses by itself.
"The material used is mercurail, I have not used before, also do not bother with the environment study; I'm using git,why?" Because there is GitHub (can be hosted online, hehe; Of course, if it is a LAN environment, you can build your own version Management Server, Git, SVN, mercurail with you like). If you know other useful online version management tools, please make sure to leave a message to me, let me learn under. 】
2.4. Jenkins
Jenkins is an open source project that provides an easy-to-use, continuous integration system that frees developers from complex integrations and focuses on more important business logic implementations. At the same time, Jenkins can implement errors in monitoring integration, provide detailed log files and reminders, and graphically display the trend and stability of project construction in the form of graphs. The installation and configuration of Jenkins is described below.
[Lone solitary nine swords] continuous integration practice-Jenkins installation and configuration
With Jenkins configured, every time the code is changed and a new version is submitted, Jenkins executes the unit test on its own, and on its settings page, it can also send the running report to the designated person for easy tracking.
3. Finally
The entire deployment does not actually take too much time, and if a continuous integration server is already set up, it is only one job and its configuration to be added each time. The trouble is that at the beginning of the study, there will be a variety of unpredictable problems, sometimes a simple spelling mistakes, sometimes it may be the version and other problems caused by the information you see described, and you actually set up the environment need to be inconsistent, so you need to learn to troubleshoot and solve these problems. In general, continuous integration is a good thing.
[Lone solitary nine swords] continuous integration Practice (i)-Intro