Author: crossley
Date: Fri Oct 21 01:48:14 2005
New Revision: 327124
URL: http://svn.apache.org/viewcvs?rev=327124&view=rev
Log:
New shell script to run forrestbot.
Added:
forrest/zone/config/run-forrestbot.sh
- copied, changed from r327086,
forrest/zone/config/forrestbot-trunk/forrestbot.sh
Copied: forrest/zone/config/run-forrestbot.sh (from r327086,
forrest/zone/config/forrestbot-trunk/forrestbot.sh)
URL:
http://svn.apache.org/viewcvs/forrest/zone/config/run-forrestbot.sh?p2=forrest/zone/config/run-forrestbot.sh&p1=forrest/zone/config/forrestbot-trunk/forrestbot.sh&r1=327086&r2=327124&rev=327124&view=diff
==============================================================================
--- forrest/zone/config/forrestbot-trunk/forrestbot.sh (original)
+++ forrest/zone/config/run-forrestbot.sh Fri Oct 21 01:48:14 2005
@@ -1,18 +1,50 @@
#!/usr/bin/bash
-# See also ~crossley/my-crontab.txt
+# Purpose:
+# - Set the environment.
+# - In certain cases, do some special processing.
+# - Change to the workspace directory.
+# - Run the relevant version of forrestbot.
+
+# See also ~crossley/my-crontab.txt which call this script.
+
+fbVersion=$3
+case $fbVersion in
+ "trunk" )
+ fbWorkspace="ft"
+ ;;
+ "trunk-stable" )
+ fbWorkspace="fts"
+ ;;
+ "release" )
+ fbWorkspace="fr"
+ ;;
+ * )
+ cat <<END
+Usage: $0 configFilename workstage fbVersion"
+where:
+ configFilename: siteName.xml e.g. cocoon-2-2.xml
+ workstage: e.g. notify
+ fbVersion: trunk|trunk-stable|release
+END
+ exit
+ ;;
+esac
export CONFIG=/export/home/config
source ${CONFIG}/setenv.sh
source ${CONFIG}/setenv-java-14.sh
-source ${CONFIG}/setenv-forrest-trunk.sh
+
+export FORREST_HOME=/export/opt/forrest-$fbVersion
+export FORRESTBOT_HOME=${CONFIG}/forrestbot-$fbVersion
+export PATH=${PATH}:${FORREST_HOME}/bin
umask 0002
-site=${2%.xml}
+site=${1%.xml}
# redirect the output of the cronjob until we have it working properly
-cron_logfile="/home/crossley/cron.out"
-echo "site=$site" > $cron_logfile
+cron_logfile="$FORRESTBOT_HOME/logs/cronout-$fbVersion-$site.txt"
+echo "site=$site fbWorkspace=$fbWorkspace" > $cron_logfile
#env >> $cron_logfile
case $site in
@@ -30,6 +62,6 @@
;;
esac
-cd $DOC_ROOT/ft
-# forrest -Dforrest.jvmargs=-Djava.awt.headless=true $* > /dev/null 2>&1
-forrest -Dforrest.jvmargs=-Djava.awt.headless=true $* >> $cron_logfile 2>&1
+cd $DOC_ROOT/$fbWorkspace
+# forrest -Dforrest.jvmargs=-Djava.awt.headless=true -f $1 $2 > /dev/null
2>&1
+forrest -Dforrest.jvmargs=-Djava.awt.headless=true -f $1 $2 >> $cron_logfile
2>&1