Skip to contentSkip to conversation

run-docs-build: build from tags dynamically instead of static list

PATCH New Michael Halstead 1 participant 1 message Apr 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 run-docs-build: build from tags dynamically instead of static list

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

---
 scripts/run-docs-build | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
scripts/run-docs-build +13 -7
index 910f03d..52bd567 100755
@@ -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
Signature · 1 line
2.30.2