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

Message ID 20220318163651.3016936-3-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, master-next and transition 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, master-next or transition
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 | 35 +++++++++++------------------------
 1 file changed, 11 insertions(+), 24 deletions(-)

Comments

Michael Opdenacker March 21, 2022, 9:06 a.m. UTC | #1
On 3/18/22 17:36, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> master, master-next and transition 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, master-next or transition
> 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 | 35 +++++++++++------------------------
>  1 file changed, 11 insertions(+), 24 deletions(-)


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

Patch

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index d8d77c7..0055b19 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -68,37 +68,24 @@  cd $outputdir
 rsync -irlp --checksum --ignore-times --delete bitbake docs@docs.yoctoproject.org:docs/
 
 cd $ypdocs
-echo Building master branch
-git checkout master
-make clean
-make publish
-cp -r ./_build/final/* $outputdir
 
-cd $ypdocs
-echo Building transition branch
-git checkout transition
-make clean
-make publish
-cp -r ./_build/final/* $outputdir/
-
-cd $ypdocs
-echo Building master-next branch
-git checkout master-next
-make clean
-make publish
-mkdir $outputdir/next
-cp -r ./_build/final/* $outputdir/next
-
-# stable branches
 # Again, keeping even the no longer supported releases (see above comment)
-for branch in dunfell gatesgarth hardknott honister; do
-    cd $ypdocs
+for branch in dunfell gatesgarth hardknott honister master master-next transition; do
     echo Building $branch branch
     git checkout $branch
     git checkout master releases.rst
     make clean
     make publish
-    mkdir $outputdir/$branch
+
+    if [ "$branch" = "master-next" ]; then
+        branch="next"
+	mkdir $outputdir/$branch
+    elif [ "$branch" = "master" ] || [ "$branch" = "transition" ]; then
+        branch=""
+    else
+	mkdir $outputdir/$branch
+    fi
+
     cp -r ./_build/final/* $outputdir/$branch
     git reset --hard
 done