aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/eigen_gen_docs
blob: bc514b5a8dad1f1de4a138d3b9e1bbfca1e3cf2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

# todo: check that at most one argument was passed.

if [ $# -eq 1 ]
then
  branch=$1
  destination=dox-$1
elif [ $# -eq 0 ]
then
  branch=default
  destination=dox-devel
fi


echo branch: $branch
echo destination: $destination

# todo: push the `pwd` to restore it at the end

rm -rf eigen_gen_docs_work_directory
mkdir eigen_gen_docs_work_directory

# todo: is it really good practice to cd all the time?

hg archive -r $branch eigen_gen_docs_work_directory/eigen2

cd eigen_gen_docs_work_directory

#todo: check that the work directory was successfully created (exit if already existing) and entered

mkdir build
cd build
cmake ../eigen2
make -j3 doc #todo: n+1 where n = number of cpus

#todo: check that make succeeded, is there a return code or something to check?

#todo: check that there exists a doc subdir
cd doc

#todo: check that there exists a html subdir
tar cfjv html.tar.bz2 html/

echo "put html.tar.bz2" > sftp_batchfile

echo "uploading the dox archive"

sftp ssh.tuxfamily.org < sftp_batchfile

echo "cd eigen/eigen.tuxfamily.org-web/htdocs
pwd
mv ../../../html.tar.bz2 .
echo uncompressing the dox archive
tar xfjv html.tar.bz2
echo removing old dox
rm -rf $destination
mv html $destination
echo giving write permissions to the group
chmod -R g+w $destination
" > ssh_batchfile

ssh ssh.tuxfamily.org < ssh_batchfile