Introduction to continuous integration

Source: Internet
Author: User

I remembered that after I graduated, I joined a foreign company focusing on software outsourcing for development. It uses traditional waterfall software development processes without any agile practices. I open my computer at work every day, get my task, update the code from version control, open the project, and press Build to prepare for today's development tasks. Suddenly I found that the Build failed (usually not compiled). I shouted "who Break Build?" And no one responded. I was depressed and checked which files caused compilation failure, find the final submitter and ask him to Fix the Build. Later, if a person in the team Break Build, some other team members wrote "XXX Break Build, invite us to dinner today" on the MSN signature. In fact, Build failures often occur during software development. Different programmers implement their own modules, write unit tests, and submit code after completion, which may inevitably lead to Build failures due to conflicts. However, developers should be able to get the fastest feedback of the current Build. If the Build fails, they must repair it in the shortest time to avoid affecting the development progress of others.

What does Build contain? It not only refers to compiling code, but also to compiling code, running all tests (including unit tests and functional tests), and running code analysis (for example, analyzing whether the Code complies with coding specifications ), deploy the system (generate executable software or deploy the website on the Web server ). Build is a series of processes used to ensure that the code can run correctly and can be released at last.

In Agile development, a very important practice is continuous integration. What is continuous integration? To put it simply, continuous integration is frequent and continuous integration in the work of multiple team members, and feedback is given. A typical continuous integration cycle includes the following steps:

  1. The continuous Integration Server constantly checks the code status from the version control server to check whether the code is updated.
  2. If the latest code is submitted, download the latest code from the version control server.
  3. After the code is completely updated, call the automated compilation script to compile the code.
  4. Run all automated tests.
  5. Code analysis.
  6. Generate executable software that can be provided to testers for testing.

If any of the steps fails, the Build fails, and the continuous integration server will give corresponding feedback. Generally, the continuous integration server has a corresponding management interface. You can view the Build status and related information. If the Build fails, you can check whether the Build fails or the test fails. Or, after each Build, the continuous integration server sends an email notification, showing the status of the latest Build in the email. Of course, you can also customize feedback methods. For example, in ThoughtWorks China, continuous integration feedback from a team is the volcano lamp, yellow indicates that the Build is in progress, and Green indicates that the Build is successful, the red color indicates that the Build fails. Once the light turns red, no one can submit the code, but the Build should be repaired as soon as possible. Another team is more creative and uses voice for feedback. If the Build succeeds, a language prompt is displayed, indicating "Build XXXX succeeded". If the Build XXXX fails, a prompt is displayed, indicating that "Build XXXX failed, submitted by XXX ", the member whose name is read must stop and fix the Build.

The purpose of continuous integration practice is not to reduce the number of Build failures, but to discover problems as early as possible, solve problems in the shortest time, and reduce risks and waste. If you want to try continuous integration, the first thing you need is the continuous integration server, such as CruiseControl or VSTS. Then you need to automate the existing Build, such as writing Ant scripts; the last step is to configure on the continuous integration server, such as configuring version control, integration interval, deployment, and feedback.

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.