[yocto-autobuilder-helper,4/6] scripts: run-docs-build: automatically build new yocto-docs branches

Message ID 20220318163651.3016936-4-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>

Since commit 01dd5af7954e24552aca022917669b27bb0541ed, all later
releases of yocto-docs can be built with Sphinx. Instead of manually
updating this list, let's have git return the list of remote branches
which contains the commit.

dunfell branch was initially released without Sphinx support but was
later patched, hence why it's explicitly listed.

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

Comments

Michael Opdenacker March 21, 2022, 9:07 a.m. UTC | #1
On 3/18/22 17:36, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> Since commit 01dd5af7954e24552aca022917669b27bb0541ed, all later
> releases of yocto-docs can be built with Sphinx. Instead of manually
> updating this list, let's have git return the list of remote branches
> which contains the commit.
>
> dunfell branch was initially released without Sphinx support but was
> later patched, hence why it's explicitly listed.
>
> Cc: Quentin Schulz <foss+yocto@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>  scripts/run-docs-build | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)


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

Patch

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index 0055b19..1656975 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -70,7 +70,18 @@  rsync -irlp --checksum --ignore-times --delete bitbake docs@docs.yoctoproject.or
 cd $ypdocs
 
 # Again, keeping even the no longer supported releases (see above comment)
-for branch in dunfell gatesgarth hardknott honister master master-next transition; do
+first_sphinx_commit=01dd5af7954e24552aca022917669b27bb0541ed
+for branch in dunfell transition $(git branch --remote --contains "$first_sphinx_commit" --format '%(refname:lstrip=3)'); do
+    if [ "$branch" = "HEAD" ]; then
+        continue
+    fi
+
+    # Do not build <release>-next branches as they are development branches only
+    # Do build master-next branch though!
+    if echo "$branch" | grep -v "master-next" | grep -q -E "-next$"; then
+        continue
+    fi
+
     echo Building $branch branch
     git checkout $branch
     git checkout master releases.rst