[PATCH v2 yocto-autobuilder-helper] run-docs-build: build from tags dynamically instead of static list


Michael Halstead
 

Build Sphinx docs for all versions newer than yocto-3.1.5 inclusive.
Integrate suggestions from Quentin Schulz and Nicolas Dechesne.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
---
scripts/run-docs-build | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index 910f03d..52bd567 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -77,13 +77,19 @@ for branch in dunfell gatesgarth hardknott; do
done

# Yocto Project releases/tags
-for tag in 3.1.5 3.1.6 3.2 3.2.1 3.2.2 3.2.3; do
- cd $ypdocs
- git checkout yocto-$tag
- make clean
- make publish
- mkdir $outputdir/$tag
- cp -r ./_build/final/* $outputdir/$tag
+v_sphinx='yocto-3.1.5' #This and newer versions have Sphinx docs.
+cd $ypdocs
+for tag in $(git tag --list 'yocto-*'); do
+ first=$(printf '%s\n%s' $tag $v_sphinx | sort --version-sort | head -n1)
+ if [ "$first" = "$v_sphinx" ]; then
+ cd $ypdocs
+ git checkout $tag
+ make clean
+ make publish
+ version=$(echo $tag | cut -c7-)
+ mkdir $outputdir/$version
+ cp -r ./_build/final/* $outputdir/$version
+ fi
done

# Update switchers.js with the copy from master ypdocs
--
2.30.2