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


Quentin Schulz
 

From: Quentin Schulz <quentin.schulz@...>

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@...>
Signed-off-by: Quentin Schulz <quentin.schulz@...>
---
scripts/run-docs-build | 35 +++++++++++------------------------
1 file changed, 11 insertions(+), 24 deletions(-)

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/

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
--
2.35.1


Michael Opdenacker
 

On 3/18/22 17:36, Quentin Schulz wrote:
From: Quentin Schulz <quentin.schulz@...>

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@...>
Signed-off-by: Quentin Schulz <quentin.schulz@...>
---
scripts/run-docs-build | 35 +++++++++++------------------------
1 file changed, 11 insertions(+), 24 deletions(-)

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

--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com