diff options
Diffstat (limited to 'build-composite.sh')
-rwxr-xr-x | build-composite.sh | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/build-composite.sh b/build-composite.sh index 574c4ecd9..714bd5bbc 100755 --- a/build-composite.sh +++ b/build-composite.sh @@ -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() { @@ -65,31 +65,45 @@ done # NOTE: Removing index.rst in project repos to reduce number of docs. find docs/projects -type f -name 'index.rst' -print | xargs -I i rm -f i -# Correct Image file path (workaround) -sed -i -e '/^.. figure::/s|images|../projects/promise/configguide/images|' \ - docs/projects/promise/configguide/featureconfig.rst +# fix relative file paths +pattern='.. \(include\|figure\):: *[^ \/]' +base_path="/$(pwd)/docs_build/_src" +find docs/projects -type f -name '*.rst' -print | while read f +do + sed -i -e "/$pattern/s|:: *|:: $base_path/$(dirname ${f#docs/})/|" $f +done + +# for debug +grep -e '.. include::' -e '.. figure::' -r docs/projects # NOTE: automated link generation is not ready... echo echo "Creating document links" echo -#for guide in configguide/installer-config.rst configguide/feature-config.rst \ -# configguide/postinatall.rst \ -# userguide/feature-usage.rst userguide/test-usage.rst -for guide in configguide/feature-config.rst +targets=" +configguide/installer-config.rst +configguide/feature-config.rst +userguide/test-usage.rst +userguide/feature-usage.rst +" +# configguide/post-install.rst +for guide in $targets 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:" |