install and configure cc with standard configuration

1. make sure that JDK installed and JAVA_HOME configured.

2. sudo vim cruisecontrol.sh, modify webport

3. replace config.xml

4. remove useless project under /logs and /projects

5. cd /projects, mkdir marsrover

6. cd /marsrover, run svn checkout http://marsrover.googlecode.com/svn/trunk/ . (don't miss .)

7. start cruise.

See the config.xml below:

<cruisecontrol>

    <project name="marsrover">     <!-- should be the same as the project directory name-->
    <!-- NOTE: if you want to force build even if no code modifications detected, you can add requiremodification="false" to the project attributes -->
    <!--
    there are some different scenerios -
    http://confluence.public.thoughtworks.org/display/CC/CruiseControl+Scheduling+Scenarios
    -->
        <listeners>
        <!-- listening for status change, such as waiting for build, queued, building, etc. Normally we won't change this configuration -->
            <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
        </listeners>
      
        <!-- NOTE: CC doesn't support check out the code on the first time, so you should check out code to the project directory first.-->
        <!-- NOTE: if you're using https to update code, then the code should checked out firstly with command line, and accept certification permanently-->
        <bootstrappers>
        <!-- this element is used to checkout code, we use svn here, localWorkingCopy is used to check out code to local file system-->
            <svnbootstrapper localWorkingCopy="projects/${project.name}"/>
        </bootstrappers>

        <modificationset quietperiod="30">
        <!--if the code changed, and there are no checkins within quietperiod seconds, the cc will check out code from the repository-->
             <svn localWorkingCopy="projects/${project.name}"/>
             <!-- here we do a forced nightly build, it will create a faked modification on 11pm,
                    then it needn't <project requiremodification="false"> -->
             <timebuild time="2300"/>
        </modificationset>

        <schedule interval="300">
        <!-- do CI during the day, every 5 minutes-->
        <!-- cc will launch a build every interval seconds, here we uses ant with the specified build file-->
        <!-- NOTE: user can also specify time attribute to ant, such as <ant time="2300"> means build on 23:00-->
            <ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/>
        </schedule>

        <log>
        <!-- save log file, the file will be saved under logs/${project.name} by default-->
            <merge dir="projects/${project.name}/target/junit-test-report"/> <!-- merge the build result -->
            <!-- if we want to see the just test result in cc, the junit result should be located under the same directory as described above -->
            <merge file="projects/${project.name}/target/checkstyle_report.xml"/>
            <!-- to show the checkstyle result on the cc page, we should edit /webapps/cruisecontrol/main.jsp, and uncomment the lines below:
            <cruisecontrol:tabrow/>
            <cruisecontrol:tab name="checkstyle" label="CheckStyle">
              <%@ include file="checkstyle.jsp" %>
            </cruisecontrol:tab>
            -->
        </log>

        <publishers>
        <!-- publish the build result to the specified location, there are many plugins in cc to do all kinds of publishing, such as send out
            email, call the specified page using http, play music, etc. -->
            <onsuccess>
            <!-- specify what will be published when build succeeded-->
                <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/${project.name}.jar"/>
                <!-- in the element above, we must make sure that the built jar file should be exactly named as ${project.name}.jar-->
            </onsuccess>
<!-- NOTE: if you want cruisecontrol to report a test failure as a build failure, you need to make Ant report the test failure as a failure. just like this:

<junit fork="true" haltonfailure="false"  failureproperty="junit_test_failed" printsummary="on">
</junit>
<fail if="junit_test_failed" message="One or more JUnit  tests failed"/>

see: http://confluence.public.thoughtworks.org/display/CC/FailOnTestFailure
-->
            <htmlemail mailhost="smtp.gmail.com" mailport="465" usessl="true" username="xxx@gmail.com" password="xxx" reportsuccess="always" returnaddress="build@xxx.com" subjectprefix="xxx build logs">
                <always address="xxx@gmail.com" />
            </htmlemail>          

        </publishers>
    </project>
</cruisecontrol>

你可能感兴趣的:(jsp,ant,SVN,JUnit,vim)