Changeset 1893

Show
Ignore:
Timestamp:
02/06/07 19:50:33 (1 year ago)
Author:
moseley
Message:

Updates for automatic processing -- daily builds, etc.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • swish_website/README

    r1891 r1893  
    235235                    -c hypermailrc \ 
    236236                    -d $ROOT/archive.new \ 
     237            && mv $ROOT/archive $ROOT/archive.old \ 
    237238            && mv $ROOT/archive.new $ROOT/archive 
    238239 
     
    393394        4) reindex when new archives messages have been added 
    394395 
    395  
    396 8,15,37,45 * * * *      . $HOME/.bashrc && rm time_to_index 2>/dev/null && cd swish/search && perl index_hypermail.pl ../archive | swish-e -c swish.conf -S prog -i stdin -v0 
    397 33 3-19 * * *           . $HOME/.bashrc && cd $HOME/swish/swish_website && ./build.sh 
    398 55 1 * * *              . $HOME/.bashrc && swish-daily.pl --tardir=$HOME/swish/swish-daily --topdir=$HOME/swish/swish_daily_build || echo "Check Swish Daily Build" 
    399 20 2 * * *              . $HOME/.bashrc && cd $HOME/swish/swish_website && ./build.sh -all 
    400  
     396        See etc/crontab 
    401397 
    402398 
     
    404400-------- 
    405401 
    406 TODO 
    407402 
    408403    Procmail is used to look for email messages from the swish-e list. 
     
    411406    know that the archive needs to be re-indexed. 
    412407 
    413 #  ===== Debugging Settings ======== 
    414  
    415     # Set log file location 
    416     LOGFILE=$HOME/procmail.log 
    417  
    418     # Set on for debug -- Extended diags 
    419     # Options: VERBOSE=off|on 
    420     VERBOSE=off 
    421  
    422  
    423     # Writes From_ and Subject, deliver folder, and length if on 
    424     # Options: LOGABSTRACT=all|no 
    425     LOGABSTRACT=all 
    426  
    427 SHELL=/bin/sh 
    428 HYPERMAIL=/home/bmoseley/local/bin/hypermail 
    429 ARCHIVE_DIR=/home/bmoseley/swish 
    430 FILENUM=`/bin/date -u +%Y%m` 
    431  
    432  
    433 :0 
    434 * ^TOusers@lists.swish-e.org 
    435 
    436         # chdir to the archive directory 
    437         MAILDIR=$ARCHIVE_DIR 
    438  
    439         # Save the archived mbox message 
    440         :0wc: 
    441         | gzip -c >> mbox/swish_$FILENUM.gz 
    442  
    443         # update the hypermail archive 
    444         # This probably should be done with cron, not when the mail comes in. 
    445         :0wc 
    446         | $HYPERMAIL -i -u -c hypermailrc -d archive 
    447  
    448         # Set flag that it needs to be indexed 
    449         :0ih 
    450         | touch $HOME/time_to_index 
    451 
    452  
    453 :0 
    454 ! moseley@hank.org 
    455  
    456  
     408    See etc/procmailrc 
     409 
     410    ln -s $ROOT/etc/procmailrc .procmailrc 
     411 
     412 
     413============================= NOTE ==================================================== 
    457414 
    458415Note: Sat Feb  3 20:36:10 PST 2007 
  • swish_website/build.sh

    r1886 r1893  
    33# Rebuild the site, and if any files are written reindex 
    44# This is expected to be run as a cron job 
    5 # cd to the swish_website dir then run this script 
     5 
     6if test ! -n "$1"; then 
     7    echo "Must specify path to the root of the site (e.g. $HOME)" 
     8    exit 1 
     9fi 
     10 
     11# Directory where everything happens 
     12ROOT="$1" 
     13shift; 
    614 
    715 
    8 # Directory where everything happens 
    9 WEB_ROOT="$(pwd)/.." 
    10  
    11  
    12 # Path to the archive index file -- so search script can find the index. 
    13 ARCHIVE_INDEX="$WEB_ROOT/swish/search/index.swish-e" 
    14  
    15 # Path to swish-e source to find pods for building the docs 
    16 SWISH_SRC="$WEB_ROOT/swish_src" 
    17  
    18 # Path to the daily build soruce to build the dev docs 
    19 DEV_SRC="$WEB_ROOT/devel_src" 
    20  
    21  
    22 SWISH_SITE=http://swish-e.org 
    23 SPIDER_QUIET=1 
    24 export SWISH_SITE SPIDER_QUIET 
     16SVN="$ROOT/swish_website" 
    2517 
    2618 
    2719# Where to store output from svn  
    28 TMP=tmp/swish_website.$$.tmp 
     20TMP=/tmp/swish_website.$$.tmp 
    2921 
    3022 
    3123# First try and do a svn update 
     24 
     25cd $SVN 
    3226 
    3327if ! svn update &>$TMP; then 
     
    5751 
    5852 
     53 
     54SWISH_SITE=${SWISH_SITE:=http://swish-e.org} 
     55SPIDER_QUIET=${SPIDER_QUIET:=1} 
     56 
     57export SPIDER_QUIET 
     58 
    5959# Now build the website, if any -a passed or if "Updated to revision" is returned. 
    6060# Or perhaps could just check for (A|C|D|U|G) 
     
    6262if [ -n "$(echo $@ | grep -- '-a')"  ] || egrep '^Updated to revision' $TMP >/dev/null; then 
    6363    echo "updating site" 
    64     bin/build \ 
    65         -archive=$ARCHIVE_INDEX \ 
    66         -swishsrc=$SWISH_SRC \ 
    67         -develsrc=$DEV_SRC \ 
    68         $@ \ 
    69     && swish-e -c etc/swish.config -S prog -v 0 
     64 
     65    $SVN/bin/build --root $ROOT $@ \ 
     66    && swish-e \ 
     67        -c $SVN/etc/swish.config \ 
     68        -S prog \ 
     69        -f $ROOT/indexes/index.swihs-e \ 
     70        -v 0 
    7071fi 
    7172 
    7273 
    73  
    7474rm $TMP 
  • swish_website/src/search/index.html

    r1889 r1893  
    213213            ? { message => $request->{message } } 
    214214            : run_query( $instance ); 
     215 
     216        warn sprintf("Query=[%s] Hits=[%d]\n", 
     217            $instance->{request}->{swish_query} || '', 
     218            $instance->{result}->{hits} || 0 ); 
     219 
    215220    } 
    216221 
     
    225230    print $cgi->header; 
    226231    print $fill_in_object->fill( scalarref => $output, fobject => $cgi ); 
    227  
    228     warn sprintf("Query=[%s] Hits=[%d]\n", 
    229         $instance->{request}->{swish_query} || '',  
    230         $instance->{result}->{hits} || 0 ); 
    231232 
    232233    delete $instance->{request};  # clean up the request