At line 3 changed 1 line. |
<div class="note" style="margin: 5px">__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|http://www.clarkware.com/cgi/blosxom/2004/10/19#TheyNeedABuildMachine] |
<div class="note" style="margin: 5px">__NOTE:__ I recommend setting up CruiseControl on a Linux machine if you [have one available|http://www.clarkware.com/cgi/blosxom/2004/10/19#TheyNeedABuildMachine] |
At line 8 changed 1 line. |
1. [Download|http://prdownloads.sourceforge.net/cruisecontrol/cruisecontrol-2.2.zip?download] and install CruiseControl. Extract it to your $TOOLS_HOME directory, wherever that may be. |
1. [Download|http://cruisecontrol.sourceforge.net/download.html] and install CruiseControl 2.4.1. Extract it to your $TOOLS_HOME directory, wherever that may be. |
At line 10 changed 1 line. |
2. After you've installed CruiseControl, create a ''cc'' user and a ''work'' directory in their home directory. |
2. After you've installed CruiseControl, download the following files and put them in the cruisecontrol-2.4.1 ($CC_HOME) directory. |
At line 12 removed 2 lines. |
3. Download the following files and put them in the "work" directory: |
|
At line 16 removed 1 line. |
* [cruise.sh] |
At line 20 changed 1 line. |
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. |
3. Modify config.xml for your e-mail address and project name. |
At line 22 changed 1 line. |
5. Modify config.xml for your Ant path and publishing directories. |
4. Modify build.xml so it points to your CVS server and project. |
At line 24 changed 1 line. |
6. Modify build.xml so it points to your CVS server and project. |
5. Run "ant" in the current directory or checkout your project into the "projects". |
At line 26 changed 1 line. |
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. |
6. Run cruisecontrol.bat (Windows) or cruisecontrol.sh (Unix). |
At line 28 removed 4 lines. |
8. Create a "logs/appfuse" directory in the current directory. |
|
9. Run "cruise.sh". |
|
At line 39 changed 1 line. |
After getting all the above working, I setup CruiseControl to run as a daemon. I has some issues with getting [these instructions|http://confluence.public.thoughtworks.org/display/CC/RunningCruiseControlFromUnixInit] working, so I [pinged the mailing list|http://sourceforge.net/mailarchive/forum.php?thread_id=6341034&forum_id=2203]. After a few back-and-forth e-mails, the following solution worked for me on Suse 9.0. |
After getting all the above working, I setup CruiseControl to run as a daemon. I has some issues with getting [these instructions|http://confluence.public.thoughtworks.org/display/CC/RunningCruiseControlFromUnixInit] working, so I [pinged the mailing list|http://www.nabble.com/forum/ViewPost.jtp?post=3195390&framed=y]. After a few back-and-forth e-mails, the following solution worked for me on Suse 10. |
At line 44 changed 1 line. |
#!/bin/sh |
#!/bin/sh |
#content of /opt/cruisecontrol/init script |
# chkconfig: 345 99 05 |
# description: CruiseControl build loop (see /home/tools) |
At line 42 added 3 lines. |
# based on http://confluence.public.thoughtworks.org/display/CC/RunningCruiseControlFromUnixInit |
# adapted for multiple projects |
|
At line 47 changed 3 lines. |
# 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 |
# Cruise Control startup: Startup and kill script for Cruise Control |
At line 52 changed 7 lines. |
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 |
PATH=/sbin:/usr/sbin:/usr/bin:/bin |
export PATH |
At line 60 changed 3 lines. |
# |
# DO NOT CHANGE ANTHING BELOW THIS LINE |
# |
NAME=cruisecontrol |
DESC="CruiseControl 2.2 continuous integration build loop" |
At line 64 changed 1 line. |
umask 002 |
CC_USER=mraible |
CC_WORK_DIR=/opt/tools/cruisecontrol |
CC_INSTALL_DIR=/opt/tools/cruisecontrol |
At line 66 changed 1 line. |
export CCDIR |
CC_DAEMON=$CC_INSTALL_DIR/cruise.sh |
CC_CONFIG_FILE=$CC_WORK_DIR/config.xml |
CC_LOG_FILE=$CC_WORK_DIR/cruisecontrol.log |
CC_PORT=8082 |
CC_RMIPORT= |
CC_COMMAND="$CC_DAEMON -configfile $CC_CONFIG_FILE -port $CC_PORT -rmiport $CC_RMIPORT" |
At line 68 changed 2 lines. |
# PPID is read-only |
PARPID=`ps -ea -o "pid ppid args" | grep -v grep | grep "${CCSTARTSCRIPT}" | sed -e 's/^ *//' -e 's/ .*//'` |
# overwrite settings from default file |
if [ -f /etc/default/cruisecontrol ]; then |
. /etc/default/cruisecontrol |
fi |
At line 71 added 10 lines. |
test -f $CC_DAEMON || exit 0 |
|
if [ `id -u` -ne 0 ]; then |
echo "Not starting/stopping $DESC, you are not root." |
exit 4 |
fi |
|
# PPID is read-only in my shell - GNU bash, version 2.05b.0(1)-release (i586-mandrake-linux-gnu) |
PARPID=`ps -ea -o "pid ppid args" | grep -v grep | grep "${CC_DAEMON}" | sed -e 's/^ *//' -e 's/ .*//'` |
|
At line 73 changed 1 line. |
PID=`ps -ea -o "pid ppid args" | grep -v grep | grep java | grep "${PARPID}" | \ |
PID=`ps -ea -o "pid ppid args" | grep -v grep | grep java | grep "${PARPID}" | \ |
At line 78 changed 1 line. |
|
|
At line 80 changed 2 lines. |
su - ${CCUSER} -c "${CCCOMMAND}" > ${CCLOGFILE} 2>&1 & RETVAL=$? |
echo "cruisecontrol started with jmx on port ${CCPORT}" |
# going into the work dir allows for use of relative PATHs in the config file |
cd $CC_WORK_DIR |
su $CC_USER -c "$CC_COMMAND >> $CC_LOG_FILE 2>&1" & RETVAL=$? |
echo "$NAME started with jmx on port ${CC_PORT}" |
At line 87 changed 1 line. |
kill -9 ${PID} ${PARPID} |
kill -9 ${PID} ${PARPID} |
At line 91 changed 1 line. |
echo "cruisecontrol is not running" |
echo "$NAME is not running" |
At line 97 changed 1 line. |
kill -0 ${PID} >/dev/null 2>&1 |
# echo PARPIDs $PARPID |
# echo PIDs $PID |
kill -0 $PID >/dev/null 2>&1 |
At line 100 changed 1 line. |
echo "cruisecontrol (pid ${PARPID} ${PID}) is running" |
echo $NAME \(pids $PARPID $PID\) is running |
At line 103 changed 1 line. |
echo "cruisecontrol is stopped" |
echo "$NAME is stopped" |
At line 117 removed 1 line. |
|
At line 119 changed 8 lines. |
exit ${RETVAL} |
}}}</div> |
|
* Create a symlink to it from /etc/rc.d/rc5.d so CruiseControl will start when the server boots. |
<div style="margin-left: 40px"> |
{{{ |
cd /etc/rc.d/rc5.d |
ln -s /etc/init.d/cruisecontrol S18cruisecontrol |
#echo ending $0 $$.... |
exit 0; |