Continuous Integration and Build Management

A project I recently participated in, and the first project I participated in as an AD. For the first time, it is very important to everyone, so this project must be done well, so the continuous integration and construction management of the project are introduced in the project development process.

    The purpose of introducing build management is to automate the construction and delivery of projects and promote a virtuous cycle of software development. The introduction of continuous integration is to advocate the early detection and elimination of errors introduced into software products by integration in the process of frequent execution of builds. If in the software development process, if there is no good management, it can only be: predecessors planted grass, and later generations weeded. Therefore, every child of the maintenance project was an angel with broken wings in his previous life, and he would marry if he met him. Well, without further ado, let's get to the point.

    The continuous integration architecture used in this project is Subversion+CruiseControl+ant in the windows environment, where Subversion is the source code control system, CruiseControl is the continuous integration server, and ant is the automated build script. Speaking of maven here, there are many people who say that maven is better than ant, but many things have to be divided into two. Not all milk is tronsu, and not all projects are suitable for maven Do an automated build.

    software download:

    Subversion Server:  http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=11151&expandFolder=11151&folderID=91

    Subversion client: http://tortoisesvn.net/ (server and client must have the same version)

    CruiseControl (cc) Continuous Integration Server: http://cruisecontrol.sourceforge.net/download.html  

    Manage the source code in the project with Subversion, and then install CruiseControl. After cc is installed, you can check its directory structure. The projects to be built are stored under the projects folder, and the projects to be built are checked out to this folder. Add the configuration of the project to the config.xml configuration file:

    <cruisecontrol>

 

 

     <project name="syljg">

     <!-- Monitor whether the code is updated-->

 

 

        <listeners>

            <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>

        </listeners>

       <!-- build.xml executed at build time-->

        <bootstrappers>

            <antbootstrapper anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml" target="clean" />

        </bootstrappers>

        <!-- Set up rotation to update the code on the svn server-->

 

        <modificationset quietperiod="30">

            <svn localWorkingCopy="projects/${project.name}" RepositoryLocation="http://svn-server2:8080/svn/mzylfl/${project.name}" username="renhanxiang" password="rhx" />

        </modificationset>

       <!-- Set the execution build interval->

        <schedule interval="60">

            <ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/>

        </schedule>

        <log>

            <merge dir="projects/${project.name}/target/test-results"/>

        </log>

        <!-- After the build is successful, the war package is generated->

        <publishers>

            <onsuccess>

                <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/target/${project.name}.war"/>

            </onsuccess>

       </publishers>

    </project>

</cruisecontrol>

Double-click cruisecontrol.bat to start the server, and then view the build results in http://localhost:8080/dashboard.

In this way, every time the developer submits the source code and test code to the svn server, cc will automatically detect the update and then automatically execute the test case and build the project, which effectively guarantees the quality of the code and ensures that each generated is a Publishable product.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326425949&siteId=291194637