[yocto-autobuilder-helper,1/6] scripts: run-docs-build: factor out all bitbake branches building

Message ID 20220318163651.3016936-1-foss+yocto@0leil.net
State New
Headers show
Series [yocto-autobuilder-helper,1/6] scripts: run-docs-build: factor out all bitbake branches building | expand

Commit Message

Quentin Schulz March 18, 2022, 4:36 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

master and master-next only differ from other branches by their output
directory name. Let's put everything in common and only have a check on
whether the branch is master or master-next and modify the output dir in
those cases.

Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 scripts/run-docs-build | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

Comments

Michael Opdenacker March 21, 2022, 8:54 a.m. UTC | #1
Hi Quentin

On 3/18/22 17:36, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> master and master-next only differ from other branches by their output
> directory name. Let's put everything in common and only have a check on
> whether the branch is master or master-next and modify the output dir in
> those cases.
>
> Cc: Quentin Schulz <foss+yocto@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Thanks for the useful patch!

Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Cheers
Michael.

Patch

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index b9b331b..f7b5f97 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -30,33 +30,29 @@  echo Extracing old content from archive
 tar -xJf $docbookarchive
 
 cd $bbdocs
-echo Building bitbake master branch
-git checkout master
-make clean
-make publish
 mkdir $outputdir/bitbake
-cp -r ./_build/final/* $outputdir/bitbake
 
-git checkout master-next
-echo Building bitbake master-next branch
-make clean
-make publish
-mkdir $outputdir/bitbake/next
-cp -r ./_build/final/* $outputdir/bitbake/next
-
-# stable branches
 # A decision was made to keep updating all the Sphinx generated docs for the moment,
 # even the ones corresponding to no longer supported releases
 # https://lists.yoctoproject.org/g/docs/message/2193
 # We copy the releases.rst file from master so that all versions of the docs
 # see the latest releases.
-for branch in 1.46 1.48 1.50 1.52; do
+for branch in 1.46 1.48 1.50 1.52 master master-next; do
     echo Building bitbake $branch branch
     git checkout $branch
     git checkout master releases.rst
     make clean
     make publish
-    mkdir $outputdir/bitbake/$branch
+
+    if [ "$branch" = "master-next" ]; then
+        branch="next"
+	mkdir $outputdir/bitbake/$branch
+    elif [ "$branch" = "master" ]; then
+        branch=""
+    else
+	mkdir $outputdir/bitbake/$branch
+    fi
+
     cp -r ./_build/final/* $outputdir/bitbake/$branch
     git reset --hard
 done