Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AppFuseSupport
Articles
Articles_cn
Articles_de
Articles_pt
Articles_zh




JSPWiki v2.2.33

[RSS]


Hide Menu

AppFuseCruiseControl


This is version 15. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


It's pretty easy to setup your AppFuse application to work with CruiseControl. You can either download the files from this page or if you're using 1.6.1+ - they're located in the extras/cruisecontrol directory. Thanks to Mike Clark and Jared Richardson for their help getting this work.

NOTE: The main lesson I learned when trying to get this to work is don't use Cygwin. In fact, I recommend you use a *nix machine if you have one available

To run CruiseControl on your AppFuse project, perform the following steps:

1. Download and install CruiseControl. Extract it to your $TOOLS_HOME directory, wherever that may be.

2. After you've installed CruiseControl, create a cc' user and a work directory in their home directory.

3. Download the following files and put them in the "work" directory:

The latest version of these files can be found in CVS or in your project's extras/cruisecontrol directory.

4. Modify cruise.sh to point to the installed directory. If you're on Windows, rename cruise.sh to cruise.bat and point to the cruisecontrol.bat file.

5. Modify config.xml for your Ant path and publishing directories.

6. Modify build.xml so it points to your CVS server and project.

7. Run "ant" in the current directory or checkout your project into the "checkout" directory (you'll need to create it). You can also run this on the "appfuse" project for testing purposes.

8. Create a "logs/appfuse" directory in the current directory.

9. Run "cruise.sh".

NOTE: If you're using Subversion instead of CVS, download svnant. Extract the download into your
work directory, delete everything but it's "lib" directory and adjust the path in build.xml accordingly.

I was puzzled why my HTML E-Mails didn't contain all the pretty formatting like Spring's does. Then I looked at their latest archived one and noticed it looks the same on Gmane as it does in GMail. I'd recommend sending your build notifications to an e-mail account that can be read with a good HTML e-mail reader.

If you want to use CruiseControl to build your Equinox project, that's in Equinox's CVS.

Setup CruiseControl Daemon

After getting all the above working, I setup CruiseControl to run as a daemon. I has some issues with getting these instructions working, so I pinged the mailing list. After a few back-and-forth e-mails, the following solution worked for me on Suse 9.0.
  • Create an /etc/init.d/cruisecontrol script with the following script. Make sure and chmod +x /etc/init.d/cruisecontrol.
#!/bin/sh

#
# Edit these variables to suit your Cruise Control installation
# chkconfig: - 345 99 05
# description: Script used to start and stop the CruiseControl auto-build system
#

CCDIR=/home/cc/cruisecontrol
CCSTARTSCRIPT=${CCDIR}/main/bin/cruisecontrol.sh
CCCONFIGFILE=/home/cc/work/config.xml
CCLOGFILE=/home/cc/cc-daemon.log
CCPORT=8000
CCCOMMAND="${CCSTARTSCRIPT} -configfile ${CCCONFIGFILE} -port ${CCPORT}"
CCUSER=cc

#
# DO NOT CHANGE ANTHING BELOW THIS LINE
#

umask 002

export CCDIR

# PPID is read-only                         
PARPID=`ps -ea -o "pid ppid args" | grep -v grep | grep "${CCSTARTSCRIPT}" | sed -e 's/^  *//' -e 's/ .*//'`

if [ "${PARPID}" != "" ]
then
  PID=`ps -ea -o "pid ppid args" | grep -v grep | grep java | grep "${PARPID}" | \                                      
      sed -e 's/^  *//' -e 's/ .*//'`
fi

case "$1" in

  'start')
    su - ${CCUSER} -c "${CCCOMMAND}" > ${CCLOGFILE} 2>&1 & RETVAL=$?
    echo "cruisecontrol started with jmx on port ${CCPORT}"
    ;;

  'stop')
    if [ "${PID}" != "" ]
    then
      kill -9 ${PID} ${PARPID}
      $0 status
      RETVAL=$?
    else
      echo "cruisecontrol is not running"
      RETVAL=1
    fi
    ;;

  'status')
    kill -0 ${PID} >/dev/null 2>&1
    if [ "$?" = "0" ]
    then
      echo "cruisecontrol (pid ${PARPID} ${PID}) is running"
      RETVAL=0
    else
      echo "cruisecontrol is stopped"
      RETVAL=1
    fi
    ;;

  'restart')
    $0 stop && $0 start
    RETVAL=$?
    ;;

  *)
    echo "Usage: $0 { start | stop | status | restart }"
    exit 1
    ;;

esac
exit ${RETVAL}
  • Create a symlink to it from /etc/rc.d/rc5.d so CruiseControl will start when the server boots.
cd /etc/rc.d/rc5.d
ln -s /etc/init.d/cruisecontrol S18cruisecontrol

That's it - you should be able to run /etc/init.d/cruisecontrol as root and CC will check for new updates every hour.


Attachments:
config.xml Info on config.xml 1692 bytes
build.xml Info on build.xml 1251 bytes


Go to top   More info...   Attach file...
This particular version was published on 06-Nov-2006 13:52:22 MST by MattRaible.