Changeset 1886

Show
Ignore:
Timestamp:
02/02/07 20:00:11 (1 year ago)
Author:
moseley
Message:

Initial updates for moving website to new machine.
Just a few more tweaks, shell scripts and httpd.conf and
we can have a beer. No, wait, beer first.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • swish_website/README

    r1871 r1886  
    11Mon Jan 17 07:32:40 PST 2005 
    2  
    3 $id$ 
     2Updated for new site Fri Feb  2 12:57:49 PST 2007 
    43 
    54Swish-e site. 
     
    87Check out the site from cvs, and modify the pages locally.  Rebuild locally 
    98to review and then check in. 
     9 
     10Overview 
     11-------- 
     12 
     13The website generation has a few dependencies.  There are scripts to generate 
     14the various parts. 
     15 
     16    - swish-e current release source 
     17        Used to build the swish-e docs. 
     18 
     19    - swish-e cvs checkout 
     20        Used to build the nightly build, and the docs from that. 
     21 
     22    - archive (hypermail) 
     23        currently, procmail feeds new posts to hypermail to 
     24        add new posts to the archive.  The posts are also archived 
     25        in the "mbox" directory by month in mbox format. 
     26 
     27    - archive index 
     28        When the archive is updated a flag is set and then cron 
     29        can re-index the hypermail archive. 
     30 
     31    - swish-daily 
     32        This is where daily tarballs are placed.  The website 
     33        creates an index page from the list of files 
     34 
     35    - swish-release 
     36        Similar to the swish-daily directory, but for releases 
     37 
     38 
     39 
     40Directory Structure 
     41------------------- 
     42 
     43    /<top level dir> 
     44 
     45        swish_daily_build/          - where the daily builds are created 
     46        swish-daily/                - daily tarballs 
     47 
     48        swish_release_build/        - where the release is build (for the docs) 
     49        distribution/               - releases (tarballs, .exe, old stuff) 
     50            old/                    - this is needed. 
     51 
     52        mbox/                       - mailbox archives by month 
     53        archive/                    - hypermail archive 
     54 
     55        indexes/                    - indexes for the archive and website 
     56 
     57        swish_website/              - source for building the site (more below) 
     58 
     59        pubilc_html                 - bulk of generated website. 
     60 
     61 
     62    Apache's DocumentRoot is pubilc_html, and swish-daily and distribution 
     63    are Aliased.  See httpd.conf. 
     64 
     65 
     66Notes on building the HTML docs 
     67------------------------------- 
     68 
     69    There's somewhat of a circular dependency.  Before the website can be 
     70    built the swish-daily needs to be generated.  This makes the pod docs 
     71    available for generating the documentation. 
     72 
     73    But, to build a daily tarball that include the HTML docs the website code 
     74    needs to be installed. 
     75 
     76    The swish-e configure script looks for the program "build-swish-docs" in the 
     77    path.  This is typically a symlink to the swish_website/bin/build program. 
     78    This program is used to build the HTML documentation that is placed in the tarball 
     79    generated by the swish-daily.pl program. 
     80 
     81 
     82 
     83Creating the above directories 
     84------------------------------ 
     85 
     86    The following examples use $ROOT as the top-level directory above. 
     87    This might be /opt/swish, for example. 
     88 
     89 
     90    swish_website 
     91    ------------- 
     92        The website isn't generated yet, but the code is needed before 
     93        building the daily tarballs. 
     94 
     95            cvn co http://svn.swish-e.org/swish_website/ $ROOT/swish_website 
     96            ln -s $ROOT/swish_website/bin/build /usr/local/bin/build-swish-docs 
     97 
     98        The actual site will be built later. 
     99 
     100 
     101 
     102 
     103    swish-daily_build / swish-daily 
     104    ------------------------------- 
     105 
     106        Use the swish-daily.pl script to create the daily builds. 
     107        The script uses the cwd for the default "topdir" if not specified, 
     108        and also has the command to check out from trunk by default. 
     109 
     110        But, it's probably more explicit to pass in the build directory 
     111        by specifying "topdir". 
     112 
     113            $ROOT/swish_website/bin/swish-daily.pl \ 
     114                --topdir=$ROOT/swish_daily_build \ 
     115                --tardir=$ROOT/swish-daily \ 
     116                || echo "Problem building swish-daily" 
     117 
     118 
     119        The script will exit non-zero if there's a problem and any errors 
     120        should be in the log files.  This should be run nightly. 
     121 
     122        swish_daily_build will be created if doesn't exist, 
     123        but the tardir directory must exist. 
     124 
     125            mkdir $ROOT/swish-daily 
     126 
     127 
     128        This does a fresh checkout.  Obviously, doing a svn update would 
     129        be much faster, but better to test a fresh checkout. 
     130 
     131        After all that there's also a script Make_Daily.sh 
     132        that does the above. 
     133 
     134 
     135 
     136    swish_release_build / distribution 
     137    ---------------------------------- 
     138 
     139        This is only run when a new release is created. 
     140        But the current release source needs to be available 
     141        so the documentation can be generated on the website. 
     142 
     143        This is similar to the above, but the source is not fetched 
     144        via svn, rather from the current release tarball. 
     145        Also, assuming the tarball is already in the releases directory 
     146        there's no need to write it to the tardir. 
     147 
     148 
     149            $ROOT/swish_website/bin/swish-daily.pl \ 
     150                --fetchtarurl=http://swish-e.org/distribution/latest.tar.gz \ 
     151                --topdir=$ROOT/swish_release_build \ 
     152                --notimestamp \ 
     153                --noremove \ 
     154                --tardir=$ROOT/distribution \ 
     155                || echo "Problem building release" 
     156 
     157        There's also a Make_Release.sh script.  Review it before use. 
     158 
     159        running --help will show available options. 
     160 
     161 
     162        Note that this can be used to generate an actual release (by fetching 
     163        from svn instead), but it's better to generate the release separately 
     164        and test it.  In that case REMOVE the --tardir option above. 
     165 
     166 
     167 
     168 
     169    mbox / archive 
     170    -------------- 
     171 
     172        Copy the existing mbox directory from where ever they currently are 
     173        located. 
     174 
     175        Generate the hypermail archive.  This needs to be done from the hypermail 
     176        directory since that's where the templates are located. 
     177 
     178        This step is only needed to create the initial archive.  The archive 
     179        is added to as new messages arrive (e.g. via procmail). 
     180 
     181            cd $ROOT/swish_website/hypermail 
     182            gzip -dc $ROOT/mbox/*.gz \ 
     183                | hypermail \ 
     184                    -i \ 
     185                    -c hypermailrc \ 
     186                    -d $ROOT/archive.new \ 
     187            && mv $ROOT/archive.new $ROOT/archive 
     188 
     189 
     190        Note, would really be good dynamically display the archive 
     191        so that the headers and footers can be shared. 
     192 
     193 
     194    indexes 
     195    ------- 
     196 
     197        This directory contains two indexes.  One for the archive and 
     198        another for the website. 
     199 
     200        The web site is not created yet, so it cannot be indexed. 
     201 
     202            mkdir $ROOT/indexes 
     203 
     204            $ROOT/swish_website/bin/index_hypermail.pl $ROOT/archive \ 
     205                | swish-e \ 
     206                    -S prog \ 
     207                    -i stdin \ 
     208                    -c $ROOT/swish_website/etc/archive.conf \ 
     209                    -f $ROOT/indexes/archive.swish-e \ 
     210                    -v0 
     211 
     212        This should be a cron task.  Normally set a flag when 
     213        the archive is updated (new message arrives). 
     214 
     215 
     216    public_html 
     217    ----------- 
     218        Now the website can be created.  The bin/build script is used 
     219        to generate the website.  The script will detect when files 
     220        need to be generated, or passing --all will tell it to generate 
     221        the complete site. 
     222 
     223        There are a lot of options, and running build --help will list them. 
     224        The same build script is used when building from cvs to generate the 
     225        html docs for the tarball. 
     226 
     227        The site must be told where to find all the directories created above. 
     228        It determines where the source files are relative to the location of the 
     229        script, but must be told everything else: 
     230 
     231 
     232            $ROOT/swish_website/bin/build \ 
     233                --dest=$ROOT/public_html \ 
     234                --archive=$ROOT/indexes \ 
     235                --swishsrc=$ROOT/swish_release_build/latest_swish_build/source \ 
     236                --develsrc=$ROOT/swish_daily_build/latest_swish_build/source \ 
     237                --download=$ROOT/distribution \ 
     238                --daily=$ROOT/swish-daily \ 
     239                --all 
     240 
     241 
     242        Luckily, there's a build script that does all that, and also indexes 
     243        the site. 
     244 
     245 
     246        indexes -- part 2 
     247        ----------------- 
     248 
     249            Once the site is it's time to build the index of the web site. 
     250 
     251 
     252 
     253 
     254 
     255 
     256 
     257 
     258 
     259 
     260 
     261 
     262 
     263 
     264 
     265 
    10266 
    11267 
  • swish_website/bin/build

    r1820 r1886  
    6868pop @src_dirs; 
    6969my $src_default     = File::Spec->catfile( @src_dirs ); 
    70 my $dest_default    = File::Spec->catfile( $src_default, 'public_html' ); 
    71 my $poddest_default = File::Spec->catfile( $dest_default, 'docs' ); 
     70# my $dest_default    = File::Spec->catfile( $src_default, 'public_html' ); 
     71# my $poddest_default = File::Spec->catfile( $dest_default, 'docs' ); 
    7272 
    7373 
    7474 
    7575my %default_config = ( 
    76     ignore  => [ '\b(CVS|RCS)\b', '^#', '\.gz$', '\.swp$'], 
     76    ignore  => [ '.svn', '\b(CVS|RCS)\b', '^#', '\.gz$', '\.swp$'], 
    7777    copy    => [ '\.(pdf|gif|png|jpe?g|htaccess)$' ], 
    7878    include => ['lib' ], 
    7979    src     => $src_default, 
    80     dest    => $dest_default, 
    81     poddest => $poddest_default, 
     80    # dest    => $dest_default, 
     81    # poddest => $poddest_default, 
    8282    websitesrc => 'src'  # default website source directory relative to -src 
    8383                          # added to INCLUDE_PATH 
     
    141141    -develsrc=<src> = Directory of development. 
    142142 
    143     -archive=<file> = Path to list archive index. 
     143    -archive=<dir>  = Path to directory where indexes are stored 
     144    -download=<dir> = Path to directory where downloads are located 
     145    -daily=<dir>    = Path to directory where daily builds are located 
    144146 
    145147    -- options you don't need -- 
     
    178180        develsrc=s 
    179181        archive=s 
     182        download=s 
     183        daily=s 
    180184        check 
    181185); 
     
    199203$SIG{__DIE__} = ''; 
    200204 
     205 
     206 
     207$config->{poddest} = File::Spec->catfile( $config->{dest}, 'docs' ) 
     208    unless $config->{poddest}; 
    201209 
    202210 
     
    327335    if ( $config->archive ) { 
    328336        my $index = File::Spec->rel2abs( $config->archive ); 
    329         die "List archive index [$index] not a normal file\n" unless -f $index; 
     337        die "List archive index [$index] not a directory\n" unless -d $index; 
    330338        $config->{archive} = $index; 
    331339    } 
  • swish_website/build.sh

    r1871 r1886  
    22 
    33# Rebuild the site, and if any files are written reindex 
     4# This is expected to be run as a cron job 
     5# cd to the swish_website dir then run this script 
     6 
     7 
     8# Directory where everything happens 
     9WEB_ROOT="$(pwd)/.." 
     10 
     11 
     12# Path to the archive index file -- so search script can find the index. 
     13ARCHIVE_INDEX="$WEB_ROOT/swish/search/index.swish-e" 
     14 
     15# Path to swish-e source to find pods for building the docs 
     16SWISH_SRC="$WEB_ROOT/swish_src" 
     17 
     18# Path to the daily build soruce to build the dev docs 
     19DEV_SRC="$WEB_ROOT/devel_src" 
     20 
    421 
    522SWISH_SITE=http://swish-e.org 
     
    724export SWISH_SITE SPIDER_QUIET 
    825 
    9 TMP=$HOME/swish_website.$$.tmp 
     26 
     27# Where to store output from svn  
     28TMP=tmp/swish_website.$$.tmp 
    1029 
    1130 
    12 if ! cvs -q update &>$TMP; then 
    13     echo "cvs update failed" 
     31# First try and do a svn update 
     32 
     33if ! svn update &>$TMP; then 
     34    echo "svn update failed" 
    1435    echo 
    1536    cat $TMP; rm $TMP 
     
    1839 
    1940# Look out for any local problems 
     41#    A  Added 
     42#    D  Deleted 
     43#    U  Updated 
     44#    C  Conflict 
     45#    G  Merged 
    2046 
    21 if egrep '^(M|C|A|R) ' $TMP >/dev/null; then 
     47# Check for conflicts -- which should not happen 
     48# unless messing with the source locally 
     49 
     50if egrep '^C ' $TMP >/dev/null; then 
    2251    echo "Some files need attention" 
    2352    echo 
     
    2554    rm  $TMP 
    2655    exit 
    27 fi  
     56fi 
    2857 
    2958 
    30 if [ -n "$(echo $@ | grep -- '-a')"  ] || egrep '^(U|P) ' $TMP >/dev/null; then 
     59# Now build the website, if any -a passed or if "Updated to revision" is returned. 
     60# Or perhaps could just check for (A|C|D|U|G) 
     61 
     62if [ -n "$(echo $@ | grep -- '-a')"  ] || egrep '^Updated to revision' $TMP >/dev/null; then 
    3163    echo "updating site" 
    32     perl bin/build \ 
    33         -archive=$HOME/swish/search/index.swish-e \ 
    34         -swishsrc=swishsrc \ 
    35         -develsrc=develsrc $@ && swish-e -c etc/swish.config -S prog -v 0 
     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 
    3670fi 
    3771 
     72 
     73 
    3874rm $TMP 
  • swish_website/lib/config/site

    r1885 r1886  
    1111        topdir   = self.topdir 
    1212        webroot  = self.src_dir 
    13         download = "${self.topdir}/public_html/distribution" 
    14         archive  = "${self.topdir}/public_html/distribution/old" 
    15         daily    = "${self.topdir}/public_html/swish-daily" 
    16     } 
     13        download = self.config.download 
     14        archive  = self.config.download _ '/old' 
     15        daily    = self.config.daily 
     16    }; 
     17 
    1718 
    1819   # URL defines (Badger book has this a separate template