source: branches/stable/tools/livwww @ 874

Last change on this file since 874 was 874, checked in by Bruno Cornec, 14 years ago

Centralize the delivery machine detection
Announce of mp3

  • Property svn:executable set to *
File size: 2.0 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
51fi
52
53svn export $optsvn ${TOOLHOME}/../website $LOCALDIR
54
55if [ $force -eq 1 ]; then
56    echo "Purging $LOCALDOC"
57    rm -rf $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    mv $LOCALDOC $LOCALDIR/docs
72    #
73    # Man pages corrections
74    #
75    perl -pi -e 's~/man8/~/docs/~g' $LOCALDIR/docs/*.8.html
76    perl -pi -e 's~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g' $LOCALDIR/docs/*.8.html
77    perl -pi -e 's~/index.html~/index.shtml~' $LOCALDIR/docs/*.8.html
78fi
79find $LOCALDIR -type d | xargs chmod 755
80find $LOCALDIR -type f | xargs chmod 644
81
82cd $LOCALDIR
83#
84# Some links for the Web site
85#
86ln -sf /var/www/html/mediawiki .
87ln -sf /var/www/html/admin .
88
89# Compute News
90$TOOLHOME/mknewshtml.pl $LOCALDIR
91
92if [ _"$1" == _"" ]; then
93        exit 0
94else
95    if [ _"$1" == _"test" ]; then
96        DESTDIR=$TESTDIR
97    else
98        DESTDIR=$MONDODIR
99    fi
100    echo "Delivering to $DESTDIR on ${DESTMACH}"
101fi
102tar cfz /tmp/mondo-www.tgz .
103scp /tmp/mondo-www.tgz ${DESTUSER}@${DESTMACH}:/tmp
104rm -f /tmp/mondo-www.tgz
105ssh ${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.