Doug said:

>Someday we should automate this...

People listened. ;)
(sorry i can't create a patch file here :-[   )

1.) add this target to the ant script:

  <!-- 
===============================================================
=== -->
  <!-- NIGHTLY.  build a nightly release                                  -->
  <!-- 
===============================================================
=== -->
<target name="nightly" depends="test, package">
     <property file="${basedir}/remote.properties" />
        <tstamp>
          <format property="time" pattern="dd-MM-yyyy-hh-mm-ss"/>

        </tstamp>
    <property name="dist.file.name" value="${final.name}.${time}.tar.gz"/>
    <exec executable="tar" dir="${build.dir}">
       <arg value="czf"/>
       <arg value="${dist.file.name}"/>
       <arg value="${final.name}"/>
     </exec>

        <!-- # in case you use key base authentication
         <scp file="${dist.file.name}"
        todir="[EMAIL PROTECTED]:${nutch.remote.folder}" 
        keyfile="${nutch.remote.keyFile}"
        passphrase="${nutch.remote.passphrase}"
          /> 
          -->
         <!-- #in case you use password authentification -->
     <scp file="${build.dir}/${dist.file.name}" todir="[EMAIL PROTECTED]:/
${nutch.remote.folder}" password="${nutch.remote.password}"/>
  </target>

2.) create a remote.properties, add following lines and setup required variables


# for nightly builds
nutch.remote.host=127.0.0.1
nutch.remote.folder=/home/nutch/
nutch.remote.user=willi
#in case you use password authentification
nutch.remote.password=tell
# in case you use key base authentication
nutch.remote.keyFile=${user.home}/.ssh/id_dsa
nutch.remote.passphrase=my extremely secret passphrase


3.) download jsch from http://www.jcraft.com/jsch/ 
Ant require Jsch for scp. I use scp instead of ftp since having a ftp Server running 
on nutch.org is a 
security problem. 

Build the jsch.jar 
JSCH_HOME/./build.sh

cp JSCH_HOME/dist/lib/jsch*.jar to $ANT_HOME/lib





4.) setup a cron job that checkout latest sources from cvs and execute following 
command in the root 
of nutch 
"ant nightly"

Since the "nightly" target depends on the "test" target only builds that pass all 
tests will delivered to the 
webserver.
 
Thats it! ;-)

As give a way i setuped a cruise control.

Find a attached the configuration file. The setup is strongly machine dependent.
I can offer to install cruise control on a nutch,org machine. In case you trust me. ;) 
There should be a 
"buildMaster" account that is just used for cruise control.
The machine require ant and a servlet container.

My personal point of view is a professional software should have cruise control or ant 
hill for building 
but more important for cvs tagging.
Here a sample of a cruise control 
http://www.weta-group.net/cruisecontrol/buildresults?

A nutch sample cruise control configuration file:

<?xml version="1.0" encoding="UTF-8"?>

<cruisecontrol>
  <project name="nutch">
    <bootstrappers>
      <currentbuildstatusbootstrapper 
file="/home/nutch/cc-logs/currentbuildstatus.txt">
      </currentbuildstatusbootstrapper>
    </bootstrappers>
    <modificationset>
      <cvs localWorkingCopy="/home/nutch/sources" cvsroot=":pserver:
[EMAIL PROTECTED]:/cvsroot/nutch">
      </cvs>
    </modificationset>
    <schedule interval="300">
      <ant buildfile="build.xml" target="clean">
       </ant>
       <ant buildfile="build.xml" target="nightly">
       </ant>
    </schedule>
                <log dir="/home/nutch/cc-logs/" />
    <publishers>
      <currentbuildstatuspublisher file="/home/nutch/cc-logs/currentbuildstatus.txt">
      </currentbuildstatuspublisher>
      <htmlemail logdir="/home/nutch/cc-logs/" mailhost="localhost" 
css="/home/nutch/reporting/
jsp/css/cruisecontrol.css" subjectprefix="[NUTCH-BUILD]" returnaddress="[EMAIL 
PROTECTED]" 
defaultsuffix="@nutch.org" xsldir="/home/nutch/reporting/jsp/xsl">
        <failure address="[EMAIL PROTECTED]">
        </failure>
      </htmlemail>
    </publishers>
  </project>
</cruisecontrol>

In cas you wish to install cruise control by your self:
http://c2.com/w4/cc/wiki.cgi?GettingStartedWithCruiseControl


HTH
Stefan




---------------------------------------------------------------
open technology:   http://www.media-style.com
open source:           http://www.weta-group.net
open discussion:    http://www.text-mining.org


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Nutch-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to