Whamcloud - gitweb
LU-2357 test: fix spelling in sanityn/36 test name
[fs/lustre-release.git] / build / publish_doxygen
1 #! /bin/bash
2
3 label=''
4 user=$USER
5 port=922
6 branch=''
7
8 # update for git!!! 
9 if [ -d lustre/CVS ] ;then
10     if [ -r lustre/CVS/Tag ] ;then
11         branch=$(cut -c2- lustre/CVS/Tag)
12     else
13         branch=HEAD
14     fi
15 fi
16
17 eval set -- $(getopt -o -b:l:du:p: -n 'publish_doxygen' -- "$@")
18
19 while true ;do
20     case "$1" in
21         -b) branch="$2"
22             shift 2
23             ;;
24         -l) label="$label$2"
25             shift 2
26             ;;
27         -u) user="$2"
28             shift 2
29             ;;
30         -d) label="$label$(date '+%Y.%m.%d')"
31             shift
32             ;;
33         -p) port="$2"
34             shift 2
35             ;;
36         --) 
37             shift 
38             break 
39             ;;
40         *) 
41             echo "Internal error!" 
42             exit 1 
43             ;;
44     esac
45 done
46
47 if [ -z "$branch" ] ;then
48     echo "No branch specified"
49     exit 1
50 fi
51
52 if [ -z "$user" ] ; then
53     echo "No user specified"
54     exit 1
55 fi
56
57 dsthost="shell.lustre.sun.com"
58 dstdir="/home/www/doxygen/$branch$label"
59
60 echo "Publishing documentation to $dsthost:$dstdir"
61
62 sshcmd="ssh -p $port -l $user"
63
64 eval $sshcmd $dsthost <<EOF
65     if [ ! -d $dstdir ]; then
66         echo "Creating $dstdir"
67         mkdir $dstdir
68     fi
69 EOF
70
71 for doctype in api ref; do
72     srcdir=doxygen.$doctype/html
73     if [ -d $srcdir ]; then
74         chmod -R a+rx $srcdir
75         rsync -rltvzp --delete --rsh="$sshcmd" $srcdir $dsthost:$dstdir/$doctype
76     fi
77 done
78
79