forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/forrestbot/webapp/WEB-INF README.txt
Date Sat, 07 Dec 2002 12:54:02 GMT
jefft       2002/12/07 04:54:02

  Modified:    src/resources/forrestbot/scripts README.txt launch-overseer
                        overseer refresh update_livesite
               src/resources/forrestbot/webapp/WEB-INF README.txt
  Log:
  Doc updates and small tweaks
  
  Revision  Changes    Path
  1.3       +32 -8     xml-forrest/src/resources/forrestbot/scripts/README.txt
  
  Index: README.txt
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrestbot/scripts/README.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- README.txt	7 Dec 2002 10:44:16 -0000	1.2
  +++ README.txt	7 Dec 2002 12:54:02 -0000	1.3
  @@ -7,6 +7,7 @@
   This directory contains shell scripts for using the Forrestbot from a webapp or
   cron job to generate multiple sites.  Contents are as follows:
   
  +launch-overseer          # Convenience script for running 'overseer'.
   overseer                 # A driver script which is used with the webapp. Invokes 'refresh'
and 'update_livesite'
   refresh                  # Main driver script. Refreshes a single site via a forrestbot
script
   refresh_all              # Convenience wrapper for 'refresh' which regens all sites. Suitable
for cron use
  @@ -15,13 +16,36 @@
   update_livesite          # WIP script to commit files to the Apache xml-site/targets/forrest
module
   work/                    # Runtime-generated directory containing forrestbot files
   
  +Prerequisites
  +-------------
  +Apart from the xml-forrest module, the only thing you'll need to run these
  +scripts is 'cvsco' from www.red-bean.com/cvsutils. If this is not found in your
  +PATH then Forrest will not be updated from CVS, which may be what you want
  +anyway. See the REGEN_FORREST flag in 'refresh'.
  +
  +
  +Cron usage
  +----------
  +Create a crontab file ('crontab -e') with contents like the following
  +
  +PATH=/bin:/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/usr/bin:/usr/serverlocal/bin
  +0 * * * * (/home/j/jeffturner/forrestbot/refresh_all)
  +
  +This runs the 'refresh_all' script every hour, which regenerates sites listed
  +in ../samples/forrestbot.conf.xml
  +
  +Webapp usage
  +------------
  +To use the forrestbot webapp:
  +1) Point your servlet container at the ../webapps directory, eg in server.xml:
  +
  +<Context path="/forrestbot" docBase="/home/jeff/apache/xml/xml-forrest/src/resources/forrestbot/webapp"
debug="0" reloadable="true"/>
  +
  +Ensure that everything except the 'refresh' button works. Use
  +forrest-dev/forrest-dev for the username/password.
  +
  +2) Run the 'launch-overseer' command.  The 'refresh' button in the webapp
  +should now trigger a regen of the selected site.
   
  -In summary, if you obtain this from CVS and wish to use it locally, you must:
  - - Create a file defining local variables, called local-vars-<name>, where
  -   <name> is output from `uname -n`. See local-vars-cocoondev.org for an example.
  -
  -In addition, to run the 'update_livesite' scripts you need to install the
  -cvsutils scripts (http://www.red-bean.com/cvsutils/) and have them in your
  -PATH.
   
   --Jeff
  
  
  
  1.2       +13 -3     xml-forrest/src/resources/forrestbot/scripts/launch-overseer
  
  Index: launch-overseer
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrestbot/scripts/launch-overseer,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- launch-overseer	7 Dec 2002 09:21:59 -0000	1.1
  +++ launch-overseer	7 Dec 2002 12:54:02 -0000	1.2
  @@ -1,9 +1,19 @@
   #!/bin/sh
   
  -# Convenience script for running 'overseer' from the console and watching the
  -# output.
  +###################################################
  +# Convenience script for running 'overseer' for use
  +# by the webapp, and watching the output.
  +###################################################
   
   . `dirname $0`/local-vars
  -./overseer < $WEBAPP/WEB-INF/commands > overseer.log &
  +
  +NAMEDPIPE=$WEBAPP/WEB-INF/commands
  +
  +if [ ! -p "$NAMEDPIPE" -a -e "$NAMEDPIPE" ]; then
  +  echo "$NAMEDPIPE exists and is not a named pipe. Please delete it and try again"
  +  exit
  +fi
  +[ ! -e "$NAMEDPIPE" ] && mkfifo $NAMEDPIPE
  +./overseer < $NAMEDPIPE > overseer.log &
   echo overseer pid: $!
   tail -f $WEBAPP/WEB-INF/refresh_log.txt overseer.log
  
  
  
  1.2       +7 -2      xml-forrest/src/resources/forrestbot/scripts/overseer
  
  Index: overseer
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrestbot/scripts/overseer,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- overseer	7 Dec 2002 09:21:59 -0000	1.1
  +++ overseer	7 Dec 2002 12:54:02 -0000	1.2
  @@ -1,11 +1,14 @@
   #!/bin/sh
   
  +###################################################
   # Script to process commands generated by the webapp
   # It listens on stdin for single-line commands of the form:
   # <action> <module>
   # Eg 'refresh xml-site', 'upload xml-forrest'
  +###################################################
   
   . `dirname $0`/local-vars
  +
   # If you change this, remember to change it in the JSP too
   REFRESH_LOG=$WEBAPP/WEB-INF/refresh_log.txt
   
  @@ -26,7 +29,6 @@
   	$BASE/update_livesite $module >> $REFRESH_LOG 2>&1
   }
   
  -IGNOREEOF=1
   while true; do
   read action module
   case $action in
  @@ -38,7 +40,10 @@
   	;;
   quit) exit
   	;;
  -'') sleep 1 ;;
  +'')
  +  # When stdin closes we get a continuous stream of EOFs.  Sleep through these.
  +  sleep 2
  +;;
   *)
   	echo "Unknown command '$action'"
   	echo "Available commands are 'refresh', 'upload'."
  
  
  
  1.2       +12 -4     xml-forrest/src/resources/forrestbot/scripts/refresh
  
  Index: refresh
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrestbot/scripts/refresh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- refresh	7 Dec 2002 09:21:59 -0000	1.1
  +++ refresh	7 Dec 2002 12:54:02 -0000	1.2
  @@ -1,16 +1,20 @@
   #!/bin/sh
   
  -# Regenerate a site's HTML with the forrestbot.
  +###################################################
  +# Regenerate a site's HTML with the latest Forrest.
  +###################################################
   
   SCRIPT=${1}
  -[ -z "$SCRIPT" ] && echo >&2 "Usage: $0 <forrestbot script>" &&
exit 1
  +[ -z "$SCRIPT" ] && echo >&2 "Usage: $0 <forrestbot script>
  +Where <forrestbot script> is the name of a file in ../samples
  +Eg: $0 xml-forrest-template-cvs.xml" && exit 1
   
   . `dirname $0`/local-vars
   # default 20 minute timeout. 
   export CVS_RSH=ssh
   export PATH=$JAVA_HOME/bin:$PATH
  -# Leaving EMAIL blank causes no email to be sent
   TSTAMP=`date +%Y-%m-%d-%k-%M`
  +# Leaving EMAIL blank causes no email to be sent
   EMAIL=
   LOGS=$WEBAPP/logs
   DEST_DIR=$WEBAPP/sites
  @@ -37,6 +41,7 @@
   	fi
   }
   
  +# Delete and rebuild the shbat distribution, optionally updating xml-forrest 
   function rebuild_forrest()
   {
     pushd .
  @@ -51,6 +56,7 @@
     popd
   }
   
  +# Populate the work/ directory with customized forrestbot scripts
   function prepare_workdir()
   {
   	pushd .
  @@ -66,6 +72,8 @@
   	popd
   }
   
  +# Run the forrestbot on $SCRIPT. Set a watchdog thread to kill the forrestbot
  +# if it seems to hang
   function forrestbot()
   {
   	cd $WORK
  @@ -82,7 +90,7 @@
   	kill $watchdogpid >/dev/null 2>&1
   }
   
  -
  +# Copy forrestbot log files to webapp
   function copy_logs()
   {
   	mkdir -p $LOGS/old
  
  
  
  1.2       +10 -3     xml-forrest/src/resources/forrestbot/scripts/update_livesite
  
  Index: update_livesite
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrestbot/scripts/update_livesite,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- update_livesite	7 Dec 2002 09:21:59 -0000	1.1
  +++ update_livesite	7 Dec 2002 12:54:02 -0000	1.2
  @@ -1,5 +1,10 @@
   #!/bin/sh
   
  +###################################################
  +# A dubious script which commits generated website
  +# contents to xml-site/targets/$MODULE 
  +###################################################
  +
   MODULE=${1:-xml-forrest}
   case $MODULE in
   	xml-forrest) TARGET="forrest" ;;
  @@ -11,8 +16,12 @@
   	echo "Please set the XML_SITE var in local-vars-`uname -n`"
   	exit
   fi	
  +SRC_DIR=$WEBAPP/sites/$MODULE
  +if [ ! -d "$SRC_DIR" ]; then
  +  echo "Expected website contents in $SRC_DIR"
  +  exit
  +fi
   LIVECVS=$XML_SITE/targets/$TARGET
  -SRC_DIR=$BASE/webapp/sites/$MODULE
   
   echo "Updating $LIVECVS from $SRC_DIR"
   pushd .
  @@ -38,5 +47,3 @@
   cvs ci -m "Automatic update at `date` by forrestrunner."
   #cvs ci
   popd
  -
  -# still testing
  
  
  
  1.2       +12 -16    xml-forrest/src/resources/forrestbot/webapp/WEB-INF/README.txt
  
  Index: README.txt
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrestbot/webapp/WEB-INF/README.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.txt	7 Dec 2002 09:33:59 -0000	1.1
  +++ README.txt	7 Dec 2002 12:54:02 -0000	1.2
  @@ -12,22 +12,18 @@
   This webapp has the loosest of couplings with the backend engine which is
   expected to do the real update/publish work: instructions are simply written to
   the WEB-INF/commands file.  It is expected that an external app will be polling
  -this file for input.
  -
  -On Linux boxen, the WEB-INF/commands file can be made the STDIN of a command,
  -via:
  -
  -mkfifo WEB-INF/commands
  -overseer < WEB-INF/commands
  -
  -Where 'overseer' is a script which accepts one-line commands via stdin.
  -
  +this file for input.  See ../../scripts/README.txt for more info.
   
   Installation
   ------------
   
  -This webapp will not work with a standard Apache/Tomcat mod_jk connection.  If
  -you look at web.xml you will see why: a number of virtual paths (/site/*,
  -/refresh/*, /logs/refresh) are used, and mod_jk does not forwards requests for
  -these paths on to Tomcat.  These need to be added by hand to httpd.conf.
  -Alternatively, use a more intelligent connector like mod_webapp.
  +Simply point Tomcat (or another servlet container) at this directory. Eg in
  +server.xml:
  +
  +<Context path="/forrestbot" docBase="/home/jeff/apache/xml/xml-forrest/src/resources/forrestbot/webapp"
debug="0" reloadable="true"/>
  +
  +Note: this webapp will not work with a standard Apache/Tomcat mod_jk
  +connection.  If you look at web.xml you will see why: a number of virtual paths
  +(/site/*, /refresh/*, /logs/refresh) are used, and mod_jk does not forwards
  +requests for these paths on to Tomcat.  These need to be added by hand to
  +httpd.conf.  Alternatively, use a more intelligent connector like mod_webapp.
  
  
  

Mime
View raw message