source: MondoRescue/branches/stable/tools/livwww @ 401

Last change on this file since 401 was 401, checked in by bcornec, 14 years ago
  • Integrate some SuSE patches and spec tips
  • all the doc is now under documentation (man pages, pdf, generated doc)
  • delivery process adapted consequently
  • Property svn:executable set to *
File size: 1.6 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#
10LOCALDIR=/var/www/html/mondo
11LOCALDOC=/var/www/html/mondo-doc
12DESTUSER=apache
13MONDODIR=/mondo/www/html/mondo
14TESTDIR=/mondo/www/html/test
15
16force=0
17
18if [ "$1" = "-f" ]; then
19        force=1
20        shift
21fi
22
23/sbin/ifconfig | grep -q 10.3 2>&1 > /dev/null
24if [ $? = 0 ]; then
25    DESTMACH=mondo.hpintelco.org
26else
27    DESTMACH=www1.mondorescue.org
28fi
29
30dname=`dirname $0`
31prem=`echo $dname |cut -c1`
32if [ ${prem} == "/" ]; then
33        export TOOLHOME=$dname
34else
35        export TOOLHOME=${PWD}/$dname
36fi
37
38. $TOOLHOME/common-env
39
40cd ${BASE}/svn
41
42rm -rf $LOCALDIR
43svn export ${VER}/website $LOCALDIR
44
45rm -rf $LOCALDOC
46svn export ${VER}/documentation $LOCALDOC
47cd $LOCALDOC
48make -f Makefile.howto
49make -f Makefile.man
50mv $LOCALDOC $LOCALDIR/docs
51#
52# Man pages corrections
53#
54perl -pi -e 's~/man8/~/docs/~g' $LOCALDIR/docs/*.8.html
55perl -pi -e 's~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g' $LOCALDIR/docs/*.8.html
56perl -pi -e 's~/index.html~/index.shtml~' $LOCALDIR/docs/*.8.html
57#
58# Version handling
59#
60perl -pi -e "s~VVV-rRRR~${VER}-r${REVISION}~g" $LOCALDIR/head.shtml
61
62find $LOCALDIR -type d | xargs chmod 755
63find $LOCALDIR -type f | xargs chmod 644
64cd $LOCALDIR
65if [ _"$1" == _"" ]; then
66        exit 0
67else
68    if [ _"$1" == _"test" ]; then
69        DESTDIR=$TESTDIR
70    else
71        DESTDIR=$MONDODIR
72    fi
73fi
74tar cfz /tmp/mondo-www.tgz .
75ssh ${DESTUSER}@${DESTMACH} "rm -rf ${DESTDIR} ; mkdir ${DESTDIR}"
76scp /tmp/mondo-www.tgz ${DESTUSER}@${DESTMACH}:/tmp
77rm -f /tmp/mondo-www.tgz
78ssh ${DESTUSER}@${DESTMACH} "cd ${DESTDIR} ; tar xfz /tmp/mondo-www.tgz"
Note: See TracBrowser for help on using the repository browser.