summaryrefslogtreecommitdiffstats
path: root/tools/gendoc/gendoc-mock-inside
blob: b2e7ce293e031adfea483eef5864d1cb4385a3b9 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash -x

cd $HOME/doc || exit 1

# clone all git reprositories
mkdir clones || exit 1
pushd clones || exit 1
git clone https://git.fedorahosted.org/git/openlmi-providers.git || exit 1
pushd openlmi-providers || exit 1
git checkout $1 || exit 1
popd

git clone https://git.fedorahosted.org/git/openlmi-networking.git || exit 1
pushd openlmi-networking || exit 1
git checkout $2 || exit 1
popd

git clone https://git.fedorahosted.org/git/openlmi-storage.git || exit 1
pushd openlmi-storage || exit 1
git checkout $3 || exit 1
popd

popd

# prepare output directory
OUT=~/out
mkdir $OUT

# build docs for individual providers
pushd clones/openlmi-storage/doc/admin
make fullhtml || exit 1
mkdir -p $OUT/openlmi-storage/$3
cp -r _build/html/* $OUT/openlmi-storage/$3/
# prepare the directory for inclusion in overall documentation
# we don't want class documentation here, there will be one
# on the top level
rm -rf mof/*.rst
popd

for d in account hardware logicalfile realmd service-dbus; do
    pushd clones/openlmi-providers/src/$d/doc/
    make html || exit 1
    mkdir -p $OUT/openlmi-providers/$1/$d
    cp -r build/html/* $OUT/openlmi-providers/$1/$d/
    # prepare the directory for inclusion in overall documentation
    # we don't want class documentation here, there will be one
    # on the top level
    rm -rf source/mof/*.rst
    popd
done

pushd clones/openlmi-providers/src/software/doc/admin
make html || exit 1
mkdir -p $OUT/openlmi-providers/$1/software
cp -r _build/html/* $OUT/openlmi-providers/$1/software
# prepare the directory for inclusion in overall documentation
# we don't want class documentation here, there will be one
# on the top level
rm -rf mof/*.rst
popd


pushd clones/openlmi-networking
mkdir build || exit 1
cd build || exit 1
cmake .. || exit 1
make doc || exit 1
mkdir -p $OUT/openlmi-networking/$2
cp -r doc/admin/html/* $OUT/openlmi-networking/$2/
# prepare the directory for inclusion in overall documentation
# we don't want class documentation here, there will be one
# on the top level
rm -rf doc/admin/mof/*.rst
popd

# Update project versions in RST files
sed -i -e "s/PROVIDERSVER/$1/" -e "s/NETWORKINGVER/$2/" -e "s/STORAGEVER/$3/" *.rst *.py

# Generate the overall documentation
make html || exit 1
mkdir $OUT/all
cp -r _build/html/* $OUT/all

tar cfz doc.tgz $OUT || exit 1