1 |
#!/bin/bash |
2 |
|
3 |
# Build all escript documentation on shake71 and put it on the web server |
4 |
# in the proper place so the ESSCC twiki can find it. The build command is |
5 |
# scons docs |
6 |
|
7 |
# If this fails make sure you have logged in to the repository and can |
8 |
# do password-less svn to shake200. Verify that you can do it by hand |
9 |
# with the exact same svn checkout command (full host name) as used below. |
10 |
|
11 |
# Run this nightly on shake71 via cron using: |
12 |
# 0 1 * * 0-6 /home/Work/EscriptDev/Documentation/autodocs.sh > /home/Work/EscriptDev/Documentation/log 2>&1 |
13 |
|
14 |
# Requires: |
15 |
# svn checkout from shake200 |
16 |
# scp to shake200 to upload new documentation to web site |
17 |
# epydoc |
18 |
# doxygen |
19 |
# latex |
20 |
# latex2html |
21 |
|
22 |
export PATH="/home/Work/InstallArea/python-2.4.4/bin:$PATH" |
23 |
export LD_LIBRARY_PATH="$DIR/sandbox/trunk/lib:/home/Work/InstallArea/python-2.4.4/lib" |
24 |
export PYTHONPATH="$DIR/sandbox/trunk:/home/Work/InstallArea/numarray-1.5.2/lib" |
25 |
|
26 |
DIR="/home/Work/EscriptDev/Documentation" |
27 |
|
28 |
START=`date '+%Y/%m/%d %H:%M'` |
29 |
RunDate=`date '+%Y_%m_%d'` |
30 |
|
31 |
prependpath () { test -d "$1" && export PATH="$1:$PATH"; } |
32 |
prependldpath () { test -d "$1" && export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"; } |
33 |
prependpypath () { test -d "$1" && export PYTHONPATH="$1:$PYTHONPATH"; } |
34 |
|
35 |
# For compiling and running Escript |
36 |
unset PYTHONSTARTUP |
37 |
export PYTHONHOME=/home/Work/InstallArea/python-2.4.4 |
38 |
prependpath /home/Work/InstallArea/python-2.4.4/bin |
39 |
prependldpath /home/Work/InstallArea/python-2.4.4/lib |
40 |
prependpath /home/Work/InstallArea/scons-0.98.5/bin |
41 |
prependpypath /home/Work/InstallArea/numarray-1.5.2/lib |
42 |
prependldpath /home/Work/InstallArea/mesa-7.0.3/usr/local/lib |
43 |
prependldpath /home/Work/InstallArea/vtk-5.0.4/lib |
44 |
prependpypath /home/Work/InstallArea/vtk-5.0.4/lib/python2.4/site-packages |
45 |
prependpath /home/Work/InstallArea/mpich2-1.0.7/bin |
46 |
prependpath /home/Work/InstallArea/mayavi-1.5/bin |
47 |
prependpath /home/Work/InstallArea/visit1.10.0/bin |
48 |
prependpypath /home/Work/InstallArea/epydoc-3.0.1/lib/python2.4/site-packages |
49 |
prependpath /home/Work/InstallArea/epydoc-3.0.1/bin |
50 |
|
51 |
|
52 |
finish () { |
53 |
# state will be 'FAILURE' or 'SUCCESS' |
54 |
state="$1" |
55 |
date |
56 |
# Clean up the sandbox |
57 |
cd $DIR |
58 |
/bin/rm -rf sandbox |
59 |
END=`date '+%Y/%m/%d %H:%M'` |
60 |
# cat << END_MSG | mail -s "ESYS_TESTS docs $RunDate $state" k.steube@uq.edu.au j.fenwick1@uq.edu.au |
61 |
cat << END_MSG | mail -s "ESYS_TESTS docs $RunDate $state" k.steube@uq.edu.au kensteube@gmail.com |
62 |
$2. |
63 |
The tests ran from $START to $END |
64 |
See the log file $DIR/log for info |
65 |
This mail was sent by $0 |
66 |
running via cron as $LOGNAME on `hostname`. |
67 |
END_MSG |
68 |
if [ "x$state" = "xFAILURE" ]; then |
69 |
exit 1 |
70 |
fi |
71 |
exit 0 |
72 |
} |
73 |
|
74 |
umask 022 |
75 |
|
76 |
cd $DIR || finish FAILURE "Could not cd to $DIR" |
77 |
|
78 |
/bin/rm -rf sandbox |
79 |
mkdir sandbox || finish FAILURE "Could not mkdir sandbox" |
80 |
cd sandbox || finish FAILURE "Could not cd to sandbox" |
81 |
|
82 |
echo "Checking out esys13/trunk from Subversion" |
83 |
svn checkout https://shake200.esscc.uq.edu.au/svn/esys13/trunk || finish FAILURE "Could not checkout esys13/trunk" |
84 |
|
85 |
# Generate documentation |
86 |
echo "Generating documentation" |
87 |
|
88 |
cd trunk || finish FAILURE "Could not cd to trunk" |
89 |
mkdir release release/doc || finish FAILURE "Could not create release directory" |
90 |
scons usedebug=yes usempi=no usewarnings=no docs || finish FAILURE "Could not run scons docs" |
91 |
scp -r release/doc/* shake200:/home/www/esys/esys13/nightly || finish FAILURE "Could not copy documentation to nightly area" |
92 |
|
93 |
echo "Cleaning up" |
94 |
|
95 |
finish SUCCESS "Successfully ran 'scons docs' on `hostname`" |
96 |
|