diff options
| author | Quentin Schulz <quentin.schulz@cherry.de> | 2025-01-27 19:37:05 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-02-18 15:47:37 +0000 |
| commit | 7ea05616697eaa20341fac0fab2fda28ddf7c18e (patch) | |
| tree | 2d12d1b37db7c90d904aa6b7c1a4e16abff21c4f /documentation/tools/Containerfile.zypper | |
| parent | 9d7930a4e0d0566e41ad0e0cf551cab04e847d64 (diff) | |
| download | poky-7ea05616697eaa20341fac0fab2fda28ddf7c18e.tar.gz | |
tools: add script for building documentation inside containers
This adds a script for building a container and building the
documentation within that new container image.
The openSUSE instructions now require a --non-interactive flag otherwise
they fail to run. Sadly there doesn't seem to be a way to have this in
an environment variable à-la DEBIAN_FRONTEND=noninteractive, so we
simply do a sed on the scripts to add --non-interactive to the zypper
commands to avoid having those in the instructions provided to our
users.
Somehow tzdata package in Ubuntu doesn't respect
DEBIAN_FRONTEND=noninteractive hence why the timezone needs to be set by
hand.
(From yocto-docs rev: cefced592f1302fcb65afa9e0b1f9f5ff1570e93)
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Antonin Godard <antonin.godard@bootlin.com>
Tested-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/tools/Containerfile.zypper')
| -rw-r--r-- | documentation/tools/Containerfile.zypper | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/documentation/tools/Containerfile.zypper b/documentation/tools/Containerfile.zypper new file mode 100644 index 0000000000..f27ad1b476 --- /dev/null +++ b/documentation/tools/Containerfile.zypper | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | ARG ARG_FROM=opensuse/leap:15.4 # default value to avoid warning | ||
| 2 | FROM $ARG_FROM | ||
| 3 | |||
| 4 | ARG DOCS=opensuse_docs.sh | ||
| 5 | ARG DOCS_PDF=opensuse_docs_pdf.sh | ||
| 6 | ARG PIP3=pip3_docs.sh | ||
| 7 | |||
| 8 | # relative to the location of the dockerfile | ||
| 9 | COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh | ||
| 10 | COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh | ||
| 11 | COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh | ||
| 12 | |||
| 13 | # Zypper doesn't have environment variables to specify whether to run in | ||
| 14 | # non-interactive mode like Debian does with DEBIAN_FRONTEND and piping yes to | ||
| 15 | # the scripts doesn't need to be enough as well, so let's force all zypper calls | ||
| 16 | # to be non-interactive by adding the appropriate flag in the scripts. | ||
| 17 | RUN for script in /temp/*.sh; do \ | ||
| 18 | sed -i 's/zypper/zypper --non-interactive/' $script; \ | ||
| 19 | done | ||
| 20 | |||
| 21 | RUN zypper update -y \ | ||
| 22 | && zypper install -y sudo \ | ||
| 23 | && yes | /temp/host_packages_docs.sh \ | ||
| 24 | && yes | /temp/host_packages_docs_pdf.sh \ | ||
| 25 | && yes | /temp/pip3_docs.sh \ | ||
| 26 | && zypper clean --all \ | ||
| 27 | && rm -rf /temp | ||
| 28 | |||
| 29 | RUN git config --global --add safe.directory /docs | ||
| 30 | |||
| 31 | ENTRYPOINT ["/usr/bin/env", "make", "-C", "documentation/"] | ||
| 32 | CMD ["publish"] | ||
