Add ipv6 docs entries in feature-config.rst, post-install.rst, userguide.rst and...
[opnfvdocs.git] / build-composite.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 NEC and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 set -o errexit
12 set -o nounset
13 set -o pipefail
14 set -o xtrace
15
16 GIT_CLONE_BASE=${GIT_CLONE_BASE:-ssh://gerrit.opnfv.org:29418}
17 GERRIT_BRANCH=${GERRIT_BRANCH:-master}
18 WORKSPACE=${WORKSPACE:-/tmp}
19
20 get_repo_names() {
21     # NOTE: Not all repositories are ready for the composite docs,
22     #       so we have the repo name list here to add project docs
23     #       one by one. This will be replaced by the list in project.cfg .
24     # grep -v '^#' releng/jjb/opnfvdocs/project.cfg | sort
25     echo "sdnvpn"
26     echo "fuel"
27     echo "ipv6"
28     echo "joid"
29     echo "functest"
30     echo "apex"
31     echo "promise"
32     echo "copper"
33 }
34
35 git_clone() {
36     _repo="$1"
37
38     [[ -d "$WORKSPACE/$_repo" ]] && return 0
39     pushd $WORKSPACE
40     git clone -b $GERRIT_BRANCH --depth 1 --quiet $GIT_CLONE_BASE/$_repo
41     popd
42 }
43
44 git_clone releng
45
46 repos=$(get_repo_names)
47
48 [[ -e docs/projects ]] && rm -rf docs/projects
49 mkdir -p docs/projects
50
51 echo
52 echo "Cloning repos of participating OPNFV Projects and copying docs"
53 echo
54 for repo in $repos; do
55     echo "    $repo ($GERRIT_BRANCH)"
56     git_clone $repo
57     [[ -e $WORKSPACE/$repo/docs ]] || continue
58     [[ -e docs/projects/$repo ]] && rm -rf docs/projects/$repo
59     cp -r $WORKSPACE/$repo/docs docs/projects/$repo
60 done
61
62 # NOTE: Removing index.rst in project repos to reduce number of docs.
63 find docs/projects -type f -name 'index.rst' -print | xargs -I i rm -f i
64
65 # NOTE: automated link generation is not ready...
66 #echo
67 #echo "Creating document links"
68 #echo
69 #for guide in configguide userguide
70 #do
71 #    link_list=$WORKSPACE/docs/$guide/projects-$guide.rst
72 #    for repo in $repos
73 #    do
74 #        file=projects/$repo/$guide/$guide.rst
75 #        [[ -e $WORKSPACE/docs/$file ]] || continue
76 #        echo "" >> $link_list
77 #        echo "$repo:" >> $link_list
78 #        echo ".. include:: ../$file" >> $link_list
79 #    done
80 #done
81
82 $WORKSPACE/releng/utils/docs-build.sh
83
84 echo "Done"