From patchwork Thu May 14 10:14:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 26755 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4958EBDCBD for ; Thu, 14 May 2026 10:14:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 15CE763022; Thu, 14 May 2026 12:14:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Pz83XMmD"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D2976301A for ; Thu, 14 May 2026 12:14:36 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:1c97:ae49:136:40fb]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 2A24756D; Thu, 14 May 2026 12:14:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1778753667; bh=rCwiw43744sH3BaG5hg8nNfwv/awqil9qO3ao7eT9Hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pz83XMmDYRADZYhruDja+e8fmvWL8k6iMz2hfPmY918g3V6bJvGP1oou0hhjjy00N 4PGOAaZBzaJvLyWf3YpZtlLtiTAbohWgGmlI0W/PQrjT27OgegWFdyTbAqysZPma/b wopdtuwK4qx/nL8vhl9JcPuQaRAu8pEkMWnYcqtk= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Laurent Pinchart , =?utf-8?b?QmFybmFiw6FzIFDFkWN6?= =?utf-8?q?e?= Subject: [PATCH v4 1/2] Split documentation build into separate build step Date: Thu, 14 May 2026 12:14:16 +0200 Message-ID: <20260514101429.552173-2-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260514101429.552173-1-stefan.klug@ideasonboard.com> References: <20260514101429.552173-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Create a separate build step that builds the docs and merges the html docs and the api docs into a single docs directory. Drop the documentation build from the build-full step as it is no longer needed there. Signed-off-by: Stefan Klug Signed-off-by: Laurent Pinchart Reviewed-by: Stefan Klug Reviewed-by: Barnabás Pőcze --- .gitlab-ci/build-libcamera-docs.sh | 42 ++++++++++++++++++++++++++++++ gitlab-ci.yml | 33 ++++++++++++++++++++--- 2 files changed, 71 insertions(+), 4 deletions(-) create mode 100755 .gitlab-ci/build-libcamera-docs.sh diff --git a/.gitlab-ci/build-libcamera-docs.sh b/.gitlab-ci/build-libcamera-docs.sh new file mode 100755 index 000000000000..26aec0813007 --- /dev/null +++ b/.gitlab-ci/build-libcamera-docs.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2026 Ideas on Board +# +# Build libcamera docs and collect them in ./docs + +set -e + +source "$(dirname "$0")/lib.sh" +source "$(dirname "$0")/build-libcamera-common.sh" + +libcamera_build_docs() { + echo "Building libcamera docs" + + meson compile -C build -j$BUILD_CONCURRENT_JOBS documentation + + echo "Installing docs" + rm -rf build/install + + meson install -C build \ + --destdir install \ + --no-rebuild \ + --tags doc,doc-internal + + local doc_dir=(build/install/usr/local/share/doc/libcamera-*) + + rm -rf docs + mv "${doc_dir}/html" docs + + # Move the internal and public API directories to the correct location + # in case the libcamera documentation post-install script has not run. + for api in internal-api public-api ; do + if [[ -d "${doc_dir}/${api}" ]] ; then + rm -rf "docs/${api}" + mv "${doc_dir}/${api}" docs/ + fi + done +} + +run libcamera_setup +run libcamera_build_docs collapsed diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 2b376c5da1ee..278e69079c15 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -209,10 +209,6 @@ build-full:debian:13: - ARCH: amd64 CC: gcc-14 CXX: g++-14 - MESON_OPTIONS: >- - ${MESON_ALL_OPTIONS} - -D documentation=enabled - -D doc_werror=true - ARCH: amd64 BUILD_TYPE: release CC: gcc-14 @@ -301,6 +297,35 @@ build-package:debug: - ARCH: amd64 - ARCH: arm64 +# Build documentation. +build-docs: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:13 + - .libcamera-ci.scripts + stage: build + needs: + - job: container-debian:13 + artifacts: false + script: + - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera-docs.sh + artifacts: + name: libcamera-docs-${CI_COMMIT_SHA} + when: always + expire_in: 1 week + paths: + - build/meson-logs/ + - build/build.ninja + - docs + variables: + BUILD_TYPE: release + MESON_OPTIONS: >- + --auto-features disabled + -D pipelines=[] + -D test=false + -D documentation=enabled + -D doc_werror=true + # ------------------------------------------------------------------------------ # Lint stage - Run checkstyle.py and check merge suitability # ------------------------------------------------------------------------------ From patchwork Thu May 14 10:14:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 26756 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1BAA0BDCBD for ; Thu, 14 May 2026 10:14:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C7A2E63026; Thu, 14 May 2026 12:14:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="krDaQN47"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 261906301A for ; Thu, 14 May 2026 12:14:39 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:1c97:ae49:136:40fb]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 0F08ED7E; Thu, 14 May 2026 12:14:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1778753670; bh=Xaa6d1nDLD6WsCznlk8bq9mWdeGO+uKwufkhBYPLpCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=krDaQN47GlfKEI4jZPHxbmMFTZCuA8tQ1VeRFt0eJhTqZ1MFqr4+1XlEZKgXnV4bk 74cheoPGpz0SU4S4Rkd46EteCOeZd6J9qgosI74QFYHdWBBK5Tm+rWGF+wpvNAKxA6 ocESQxqarBKzf4MWHgqn/DXl6jgXmtBLx0ibTDMc= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , =?utf-8?q?Barnab=C3=A1s_P?= =?utf-8?b?xZFjemU=?= , Laurent Pinchart Subject: [PATCH v4 2/2] Deploy docs to docs.libcamera.org Date: Thu, 14 May 2026 12:14:17 +0200 Message-ID: <20260514101429.552173-3-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260514101429.552173-1-stefan.klug@ideasonboard.com> References: <20260514101429.552173-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a build step that deploys the docs to a server. This step only runs on pushes to master and on tag builds. It requires three external variables: DEPLOY_SSH_KEY_BASE64: base64 encoded private deploy key DEPLOY_KNOWN_HOSTS: Known hosts containing the destination DEPLOY_DESTINAION: user@host:/ for the rsync push Signed-off-by: Stefan Klug Reviewed-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- Changes in v4: - Collected tag - Added check for $DEPLOY_DESTINATION to prevent deployments in personal ci setups --- .gitlab-ci/deploy-libcamera-docs.sh | 23 +++++++++++++++++++++++ .gitlab-ci/setup-container.sh | 2 ++ gitlab-ci.yml | 29 ++++++++++++++++++++++++++++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100755 .gitlab-ci/deploy-libcamera-docs.sh diff --git a/.gitlab-ci/deploy-libcamera-docs.sh b/.gitlab-ci/deploy-libcamera-docs.sh new file mode 100755 index 000000000000..a6936728c4a9 --- /dev/null +++ b/.gitlab-ci/deploy-libcamera-docs.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2026 Ideas on Board +# +# Deploy libcamera docs + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_deploy_docs() { + echo "Deploying libcamera docs" + + rsync -rlz --delete --chmod=Do=rx,Fo=r \ + --exclude .doctrees \ + --exclude .buildinfo \ + --exclude objects.inv \ + docs/ \ + "${DEPLOY_DESTINATION}${CI_COMMIT_REF_NAME}" +} + +run libcamera_deploy_docs diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh index c7ca6426c3ab..6c4b439b887b 100755 --- a/.gitlab-ci/setup-container.sh +++ b/.gitlab-ci/setup-container.sh @@ -132,6 +132,8 @@ case $FDO_DISTRIBUTION_VERSION in python3-sphinxcontrib.doxylink texlive-latex-extra ) + # Packages required to deploy the documentation + PKGS_LIBCAMERA_RUNTIME+=( openssh-client rsync ) # Tools requires by the lint jobs. PKGS_LIBCAMERA_RUNTIME+=( clang-format jq python3-autopep8 reuse shellcheck ) # libclang-rt-dev for the clang ASan runtime. diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 278e69079c15..aad411c4e3d8 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -5,6 +5,7 @@ stages: - build - lint - test + - deploy variables: FDO_UPSTREAM_REPO: 'camera/libcamera' @@ -74,7 +75,7 @@ include: .libcamera-ci.debian:13: variables: FDO_DISTRIBUTION_VERSION: 'trixie' - FDO_DISTRIBUTION_TAG: '2026-04-24.0' + FDO_DISTRIBUTION_TAG: '2026-05-06.0' .container-debian: extends: @@ -440,3 +441,29 @@ test-lc-compliance:virtual: artifacts: reports: junit: build/lc-compliance-report.xml + +# ------------------------------------------------------------------------------ +# Deploy stage - deploy docs if we are building master or a tag +# ------------------------------------------------------------------------------ + +deploy-docs: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:13 + - .libcamera-ci.scripts + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $DEPLOY_DESTINATION + - if: $CI_COMMIT_TAG =~ /^v([0-9]+\.)*[0-9]+$/ && $DEPLOY_DESTINATION + environment: deploy + stage: deploy + needs: + - job: build-docs + script: + - | + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo "${DEPLOY_KNOWN_HOSTS}" > ~/.ssh/known_hosts + eval $(ssh-agent -s) + echo "${DEPLOY_SSH_KEY_BASE64}" | base64 -d | ssh-add - + + - $CI_PROJECT_DIR/.gitlab-ci/deploy-libcamera-docs.sh