mirror of
git://git.yoctoproject.org/yocto-autobuilder-helper.git
synced 2025-07-19 20:59:02 +02:00

The patch was meant as a quick temporary work-around to have the docs built and published. Now that releases where -W flag is set (turning warnings into errors) are appropriately patched to make those warnings disappear (on Sphinx v3.2.1 which is the one used on the builder), this patch can be reverted so that next time a warning appears the doc building will fail but will not destroy the doc website (because of commit6a4e6ef18d
"scripts: run-docs-build: make the script fail hard ASAP when there's an error", since rsync will not be run if any error happens before). This reverts commit931d409b25
. Cc: Quentin Schulz <foss+yocto@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
140 lines
4.1 KiB
Bash
Executable File
140 lines
4.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Called with $1 as the build directory
|
|
# $2 as the path to yocto-docs
|
|
# $3 as the path to bitbake
|
|
|
|
set -e
|
|
set -u
|
|
set -o pipefail
|
|
set -x
|
|
|
|
builddir=$1
|
|
ypdocs=$2/documentation/
|
|
bbdocs=$3/doc/
|
|
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]}")")"
|
|
|
|
|
|
cd $builddir
|
|
mkdir buildtools
|
|
$docs_buildtools -y -d $builddir/buildtools
|
|
. $builddir/buildtools/environment-setup*
|
|
|
|
# Getting the old docbook built docs from an archive. Not rebuilding them.
|
|
#wget https://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-archives-20201105.tar.xz
|
|
docbookarchive=/srv/autobuilder/autobuilder.yocto.io/pub/docbook-mirror/docbook-archives-20201105.tar.xz
|
|
mkdir $outputdir
|
|
cd $outputdir
|
|
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
|
|
echo Building bitbake $branch branch
|
|
git checkout $branch
|
|
git checkout master releases.rst
|
|
make clean
|
|
make publish
|
|
mkdir $outputdir/bitbake/$branch
|
|
cp -r ./_build/final/* $outputdir/bitbake/$branch
|
|
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/
|
|
|
|
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
|
|
echo Building $branch branch
|
|
git checkout $branch
|
|
git checkout master releases.rst
|
|
make clean
|
|
make publish
|
|
mkdir $outputdir/$branch
|
|
cp -r ./_build/final/* $outputdir/$branch
|
|
git reset --hard
|
|
done
|
|
|
|
# Yocto Project releases/tags
|
|
v_sphinx='yocto-3.1.5' #This and newer versions have Sphinx docs.
|
|
cd $ypdocs
|
|
for tag in $(git tag --list 'yocto-*'); do
|
|
first=$(printf '%s\n%s' $tag $v_sphinx | sort --version-sort | head -n1)
|
|
if [ "$first" = "$v_sphinx" ]; then
|
|
echo Processing $tag
|
|
cd $ypdocs
|
|
git checkout $tag
|
|
if [ -e "${scriptdir}/docs-build-patches/${tag}/" ]; then
|
|
echo Adding patch for $tag
|
|
git am "${scriptdir}/docs-build-patches/${tag}/"000*
|
|
fi
|
|
git checkout master releases.rst
|
|
make clean
|
|
make publish
|
|
version=$(echo $tag | cut -c7-)
|
|
mkdir $outputdir/$version
|
|
cp -r ./_build/final/* $outputdir/$version
|
|
git reset --hard
|
|
echo Finished processing $tag
|
|
fi
|
|
done
|
|
|
|
# get current release (e.g. most recent tag), and add a 'current' link
|
|
tag=$(git tag --list 'yocto-*' | sort --version-sort | tail -1 | cut -c7-)
|
|
echo Linking to $tag as current
|
|
ln -s $tag $outputdir/current
|
|
|
|
# Update switchers.js with the copy from master ypdocs
|
|
cd $outputdir
|
|
find . -name switchers.js -not -path ./_static/switchers.js -exec cp ./_static/switchers.js {} \;
|
|
|
|
cd $outputdir
|
|
rsync -irlp --checksum --ignore-times --delete . docs@docs.yoctoproject.org:docs/
|