Sure, script attached.  It uses a few of my other scripts so it will
need customization.  I can easily supply those missing scripts too.
I run it every 7 minutes from cron with:

        */7 * * * *     root /letc/pgsgml >/dev/null 2>&1

I can even install the whole thing on postgresql.org if you wish.  It
requires a personal crontab, of course, and a directory to put the
result.  I already have a ~momjian web directory for such stuff.

---------------------------------------------------------------------------

Tom Lane wrote:
> "Marc G. Fournier" <[EMAIL PROTECTED]> writes:
> >> Mainly because Bruce is willing to expend the cycles to rebuild his
> >> nearly on-demand.  Last I checked, the build on hub is only updated
> >> once or twice a day, so it's not as useful for verifying doc checkins.
> 
> > 'k, is there a reason why it can't be run more often?  What command on hub
> > has to be run?
> 
> AFAICT, Bruce does a "cvs update" every ten or fifteen minutes and then
> rebuilds the docs if anything changed in the doc subtree.  Bruce, maybe
> you could send Marc the script you use?
> 
>                       regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
:

cd /pgsgmlbuild

[ -f /tmp/pgsql_sgml.lock ] && exit

TRAPEXTRAFILE="/tmp/pgsql_sgml.lock"
. traprm

touch /tmp/pgsql_sgml.lock

> $TMP/1

while :
do
        CONT="N"
        if [ "X$1" = "X-f" ]
        then    CONT="Y"
                shift
        else    pgcvs update sgml > $TMP/2 2>&1 &
                BG="$!"; export BG
                (sleep 300; kill "$BG" > /dev/null 2>&1) &
                BG2="$!"; export BG2
                wait "$BG"
                if ! kill0 "$BG2"
                then    CONT="N"
                else    kill "$BG2" > /dev/null 2>&1
                        CONT="Y"
                        cat $TMP/2 |
                        grep '^[A-Z] sgml/' > $TMP/1
                        [ "$?" -ne 0 ] && CONT="N"
                fi
        fi
        if [ "$CONT" = "N" ]
        then    break
        fi

        # continue
        echo "\nBuild:  `date`" >> build.dates
        cat $TMP/1  >> build.dates
        echo "PostgreSQL CVS Documentation Build" > $TMP/0
        echo "----------------------------------\n" >> $TMP/0
        echo "Build started:  `date`" >> $TMP/0
        gmake postgres.tar.gz 2>&1 | grep -v DTDDECL > $TMP/2
        echo "Build completed:  `date`\n" >> $TMP/0
        echo "Changes in this build:" >> $TMP/0
        cat $TMP/1 >> $TMP/0
        echo "\nA full copy of this documenation is at 
ftp://candle.pha.pa.us/pub/postgresql/postgresql-docs.tar.gz\n";  >> $TMP/0
        if grep -qi 'error' $TMP/2 || grep -qi ':E:' $TMP/2
        then    echo "\nThere were errors in this build.  They appear in red.\n" >> 
$TMP/0
                cat $TMP/2 >> $TMP/0
        else    echo "\nBuild completed successfully." >> $TMP/0
        fi
        pipe sed 's;HTML.manifest:;HTML.manifest :;g' $TMP/0
        txt2html -m -s 100 -p 100 --title "PostgreSQL CVS Docs built `date`" \
        --link /u/txt2html/txt2html.dict \
        --append_head /u/txt2html/BODY $TMP/0 > build.html
        pipe sed 's;^.*[Ee]rror.*$;<FONT COLOR="RED">&</FONT>;' build.html
        pipe sed 's;^.*:E:.*$;<FONT COLOR="RED">&</FONT>;' build.html
        rm -f /var/www/docs/main/writings/pgsql/sgml/*
        mv sgml/*.html build.html /var/www/docs/main/writings/pgsql/sgml
        cp sgml/*.css sgml/*.gif /var/www/docs/main/writings/pgsql/sgml
        cp postgres.tar.gz /pgftp/postgresql-docs.tar.gz
        gmake clean > /dev/null 2>&1
        [ "X$1" = "X-f" ] && break
done
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to