source: branches/stable/tools/livwww

Last change on this file was 1233, checked in by Bruno Cornec, 13 years ago
  • LCA video announce
  • web site now deals with video and audio directories
  • various HOWTO fixes from Mike Kinney (kinneym_at_redacesolutions.com>)
  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5# Delivery of the Web site in a DocumentRoot
6#
7#
8# Please replace with your destination
9#
10
11
12LOCALDIR=/var/www/html/mondo
13LOCALDOC=/var/www/html/mondo-doc
14DESTUSER=apache
15MONDODIR=/mondo/www/html/mondo
16TESTDIR=/mondo/www/html/test
17
18force=1
19nodoc=0
20
21if [ "$1" = "--keep" ]; then
22        force=0
23        optsvn=""
24        shift
25elif [ "$1" = "-nodoc" ]; then
26        nodoc=1
27        optsvn="--force"
28        shift
29else
30        optsvn="--force"
31fi
32
33dname=`dirname $0`
34prem=`echo $dname |cut -c1`
35if [ ${prem} = "/" ]; then
36        export TOOLHOME=$dname
37else
38        export TOOLHOME=${PWD}/$dname
39fi
40
41. $TOOLHOME/common-env
42. $TOOLHOME/svn-env
43. $TOOLHOME/ftp-env
44
45# To be safe for SVN commands
46cd ${TOOLHOME}/..
47
48if [ $force -eq 1 ]; then
49    echo "Purging $LOCALDIR"
50    rm -rf $LOCALDIR/* $LOCALDIR/.??*
51fi
52
53svn export $optsvn ${TOOLHOME}/../website $LOCALDIR
54
55if [ $force -eq 1 ]; then
56    echo "Purging $LOCALDOC"
57    rm -rf $LOCALDOC/* $LOCALDOC/.??*
58fi
59
60svn export $optsvn ${TOOLHOME}/../mondo-doc $LOCALDOC
61
62#
63# Version handling
64#
65$TOOLHOME/expandver $LOCALDIR/top.shtml $LOCALDOC/mondorescue-howto.sgml $LOCALDOC/*.8
66
67if [ $nodoc -eq 0 ]; then
68    cd $LOCALDOC
69    make -f Makefile.howto
70    make -f Makefile.man
71    mkdir -p $LOCALDIR/docs
72    mv $LOCALDOC/* $LOCALDIR/docs
73    #
74    # Man pages corrections
75    #
76    perl -pi -e 's~/man8/~/docs/~g' $LOCALDIR/docs/*.8.html
77    perl -pi -e 's~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g' $LOCALDIR/docs/*.8.html
78    perl -pi -e 's~/index.html~/index.shtml~' $LOCALDIR/docs/*.8.html
79fi
80find $LOCALDIR -type d | xargs chmod 755
81find $LOCALDIR -type f | xargs chmod 644
82
83cd $LOCALDIR
84#
85# Some links for the Web site
86#
87ln -sf /var/www/html/mediawiki .
88ln -sf /var/www/html/admin .
89ln -sf ../video .
90ln -sf ../audio .
91
92# Compute News
93$TOOLHOME/mknewshtml.pl $LOCALDIR
94
95if [ _"$1" = _"" ]; then
96        exit 0
97else
98    if [ _"$1" = _"test" ]; then
99        DESTDIR=$TESTDIR
100    else
101        DESTDIR=$MONDODIR
102    fi
103    echo "Delivering to $DESTDIR on ${DESTMACH}"
104fi
105tar cfz /tmp/mondo-www.tgz .
106scp /tmp/mondo-www.tgz ${DESTUSER}@${DESTMACH}:/tmp
107rm -f /tmp/mondo-www.tgz
108ssh -q ${DESTUSER}@${DESTMACH} "rm -rf ${DESTDIR} ; mkdir ${DESTDIR} ; cd ${DESTDIR} ; tar xfz /tmp/mondo-www.tgz"
Note: See TracBrowser for help on using the repository browser.