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

Last change on this file since 872 was 872, checked in by Bruno Cornec, 15 years ago

Fix bug #79 by removing use of SVNBRANCH and BASE variable in build process
WARNING: the build process doesn't allow anymore to use the script of one version for building another version

  • 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
33/sbin/ifconfig | egrep -q '10\.3' 2>&1 > /dev/null
34if [ $? = 0 ]; then
35    DESTMACH=mondo.hpintelco.org
36else
37    DESTMACH=www.mondorescue.org
38fi
39
40dname=`dirname $0`
41prem=`echo $dname |cut -c1`
42if [ ${prem} == "/" ]; then
43        export TOOLHOME=$dname
44else
45        export TOOLHOME=${PWD}/$dname
46fi
47
48. $TOOLHOME/common-env
49. $TOOLHOME/svn-env
50
51# To be safe for SVN commands
52cd ${TOOLHOME}/..
53
54if [ $force -eq 1 ]; then
55    echo "Purging $LOCALDIR"
56    rm -rf $LOCALDIR
57fi
58
59svn export $optsvn ${TOOLHOME}/../website $LOCALDIR
60
61if [ $force -eq 1 ]; then
62    echo "Purging $LOCALDOC"
63    rm -rf $LOCALDOC
64fi
65
66svn export $optsvn ${TOOLHOME}/../mondo-doc $LOCALDOC
67
68#
69# Version handling
70#
71$TOOLHOME/expandver $LOCALDIR/top.shtml $LOCALDOC/mondorescue-howto.sgml $LOCALDOC/*.8
72
73if [ $nodoc -eq 0 ]; then
74    cd $LOCALDOC
75    make -f Makefile.howto
76    make -f Makefile.man
77    mv $LOCALDOC $LOCALDIR/docs
78    #
79    # Man pages corrections
80    #
81    perl -pi -e 's~/man8/~/docs/~g' $LOCALDIR/docs/*.8.html
82    perl -pi -e 's~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g' $LOCALDIR/docs/*.8.html
83    perl -pi -e 's~/index.html~/index.shtml~' $LOCALDIR/docs/*.8.html
84fi
85find $LOCALDIR -type d | xargs chmod 755
86find $LOCALDIR -type f | xargs chmod 644
87
88cd $LOCALDIR
89#
90# Some links for the Web site
91#
92ln -sf /var/www/html/mediawiki .
93ln -sf /var/www/html/admin .
94
95# Compute News
96$TOOLHOME/mknewshtml.pl $LOCALDIR
97
98if [ _"$1" == _"" ]; then
99        exit 0
100else
101    if [ _"$1" == _"test" ]; then
102        DESTDIR=$TESTDIR
103    else
104        DESTDIR=$MONDODIR
105    fi
106    echo "Delivering to $DESTDIR on ${DESTMACH}"
107fi
108tar cfz /tmp/mondo-www.tgz .
109scp /tmp/mondo-www.tgz ${DESTUSER}@${DESTMACH}:/tmp
110rm -f /tmp/mondo-www.tgz
111ssh ${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.