script: fix auto feature config builder 45/9845/7
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Fri, 12 Feb 2016 09:36:22 +0000 (18:36 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Fri, 12 Feb 2016 10:06:26 +0000 (19:06 +0900)
Change-Id: Ifa7249ceed9f803e3bb7fbe79caa05705e7fd42f
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
build-composite.sh
docs/configguide/feature-config.rst

index 574c4ec..a4012a1 100755 (executable)
@@ -22,17 +22,17 @@ get_repo_names() {
     #       so we have the repo name list here to add project docs
     #       one by one. This will be replaced by the list in project.cfg .
     # grep -v '^#' releng/jjb/opnfvdocs/project.cfg | sort
-    echo "sdnvpn"
+    echo "apex"
+    echo "copper"
+    echo "doctor"
+    echo "fastpathmetrics"
     echo "fuel"
+    echo "functest"
     echo "ipv6"
     echo "joid"
-    echo "functest"
-    echo "apex"
     echo "promise"
-    echo "copper"
-    echo "doctor"
+    echo "sdnvpn"
     echo "vswitchperf"
-    echo "fastpathmetrics"
 }
 
 git_clone() {
@@ -79,17 +79,20 @@ echo
 for guide in configguide/feature-config.rst
 do
     mainfile="$WORKSPACE/docs/$guide"
+    basefilename=$(basename ${guide/-/})
     for repo in $repos
     do
-        projectfile="projects/$repo/${guide//-/}"
-        projectlink="${mainfile%/*}/featureconfig-$repo.rst"
-        [[ -e "$WORKSPACE/docs/$projectfile" ]] || continue
+        targetfile="$WORKSPACE/docs/projects/$repo/${guide/-/}"
+        targetlink="../projects/$repo/${guide/-/}"
+        projectfilename="${basefilename/.rst/-$repo.rst}"
+        projectfile="$(dirname $mainfile)/$projectfilename"
+        [[ -e "$targetfile" ]] || continue
         echo "Adding $repo to $guide ..."
         echo "" >> $mainfile
         echo ".. toctree::" >> $mainfile
         echo "" >> $mainfile
-        echo "    $projectlink" >> $mainfile
-        echo ".. include:: ../$projectfile" >> $projectlink
+        echo "    $projectfilename" >> $mainfile
+        echo ".. include:: $targetlink" > $projectfile
     done
     echo
     echo "Generated $guide:"
index 29e7e09..f40bff2 100644 (file)
@@ -8,3 +8,5 @@ Feature Configuration
 
 The following sections describe the configuration options for specific platform features provided in Brahmaputra.
 Further details for each feature are captured in the referred project documentation.
+
+.. <project>/docs/configguide/featureconfig.rst files will be imported below by the build script.