[yocto-autobuilder-helper,3/6] scripts: run-docs-build: add option to skip upstream rsync

Message ID 20220419170730.124287-4-foss+yocto@0leil.net
State New
Headers show
Series [RFC] docs: update Bitbake objects.inv location for master branch | expand

Commit Message

Quentin Schulz April 19, 2022, 5:07 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

The rsync only makes sense for the Autobuilder as most people don't have
access to docs@docs.yoctoproject.org. Therefore, to allow for easier
contribution to this script, let's allow to skip the rsync so the script
can continue to run.

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

Patch

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index 6569928..a060a31 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -8,6 +8,7 @@ 
 #                     Can be found here: https://autobuilder.yocto.io/pub/buildtools/
 #   - docbookarchive as the path to old (pre 3.1.5 and Sphinx migration) docs tarball
 #                     Can be found here: https://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-archives-20201105.tar.xz
+#   - PUBLISH (0/1) for whether the files should be rsync'ed to docs.yoctoproject.org
 
 set -e
 set -u
@@ -20,6 +21,7 @@  bbdocs=$(realpath "$3/doc/")
 docs_buildtools=${docs_buildtools:-/srv/autobuilder/autobuilder.yocto.io/pub/buildtools/x86_64-buildtools-docs-nativesdk-standalone-3.2+snapshot-20201105.sh}
 outputdir=$builddir/output
 scriptdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
+PUBLISH=${PUBLISH:-1}
 
 
 cd $builddir
@@ -68,10 +70,12 @@  for branch in 1.46 $(git branch --remote --contains "$first_sphinx_commit" --for
     git reset --hard
 done
 
-# only sync bitbake folder for now. We need bitbake to be published first
-# since the bitbake intersphinx index will be downloaded to build yocto-docs
-cd $outputdir
-rsync -irlp --checksum --ignore-times --delete bitbake docs@docs.yoctoproject.org:docs/
+if [ "$PUBLISH" -ne 0 ]; then
+    # only sync bitbake folder for now. We need bitbake to be published first
+    # since the bitbake intersphinx index will be downloaded to build yocto-docs
+    cd $outputdir
+    rsync -irlp --checksum --ignore-times --delete bitbake docs@docs.yoctoproject.org:docs/
+fi
 
 cd $ypdocs
 
@@ -142,5 +146,7 @@  ln -s $tag $outputdir/current
 cd $outputdir/bitbake
 find . -name switchers.js -exec cp $outputdir/current/_static/switchers.js {} \;
 
-cd $outputdir
-rsync -irlp --checksum --ignore-times --delete . docs@docs.yoctoproject.org:docs/
+if [ "$PUBLISH" -ne 0 ]; then
+    cd $outputdir
+    rsync -irlp --checksum --ignore-times --delete . docs@docs.yoctoproject.org:docs/
+fi