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


Quentin Schulz
 

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

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

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

Join {yocto@lists.yoctoproject.org to automatically receive all group messages.