[libcamera-ci,2/2] Move ssh configuration to deploy-libcamera-docs.sh script
diff mbox series

Message ID 20260516202912.383234-3-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • Small improvements to documentation deployment
Related show

Commit Message

Laurent Pinchart May 16, 2026, 8:29 p.m. UTC
Job definitions in .gitlab-ci.yml are stored by Gitlab in jobs. This
means that a new full pipeline needs to be run when making a change to
the job, as re-running a failed job will not pick up changes to the job
definition.

To avoid this and help with development, move the ssh configuration
script to the deploy-libcamera-docs.sh file. As the libcamera-ci
repository is cloned freshly every time a job is run, changes to the
script can be tested just by re-running the job.

While at it, fix indentation in the rsync command.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .gitlab-ci/deploy-libcamera-docs.sh | 16 +++++++++++-----
 gitlab-ci.yml                       |  7 -------
 2 files changed, 11 insertions(+), 12 deletions(-)

Comments

Pőcze Barnabás May 18, 2026, 7:55 a.m. UTC | #1
2026. 05. 16. 22:29 keltezéssel, Laurent Pinchart írta:
> Job definitions in .gitlab-ci.yml are stored by Gitlab in jobs. This
> means that a new full pipeline needs to be run when making a change to
> the job, as re-running a failed job will not pick up changes to the job
> definition.
> 
> To avoid this and help with development, move the ssh configuration
> script to the deploy-libcamera-docs.sh file. As the libcamera-ci
> repository is cloned freshly every time a job is run, changes to the
> script can be tested just by re-running the job.
> 
> While at it, fix indentation in the rsync command.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Since the gitlab ci definitions are in a separate repository,
I think this change makes sense.

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   .gitlab-ci/deploy-libcamera-docs.sh | 16 +++++++++++-----
>   gitlab-ci.yml                       |  7 -------
>   2 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/.gitlab-ci/deploy-libcamera-docs.sh b/.gitlab-ci/deploy-libcamera-docs.sh
> index 639fdf748d07..d25c8275adf5 100755
> --- a/.gitlab-ci/deploy-libcamera-docs.sh
> +++ b/.gitlab-ci/deploy-libcamera-docs.sh
> @@ -12,12 +12,18 @@ source "$(dirname "$0")/lib.sh"
>   libcamera_deploy_docs() {
>   	echo "Deploying libcamera docs for ${CI_COMMIT_REF_NAME}"
> 
> +	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 -
> +
>   	rsync -rlz --delete --chmod=Do=rx,Fo=r \
> -          --exclude .doctrees \
> -          --exclude .buildinfo \
> -          --exclude objects.inv \
> -          docs/ \
> -          "${DEPLOY_DESTINATION}/${CI_COMMIT_REF_NAME}"
> +		--exclude .doctrees \
> +		--exclude .buildinfo \
> +		--exclude objects.inv \
> +		docs/ \
> +		"${DEPLOY_DESTINATION}/${CI_COMMIT_REF_NAME}"
>   }
> 
>   run libcamera_deploy_docs
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index e3274ca56e20..427f2d2516dc 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -461,11 +461,4 @@ deploy-docs:
>     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
> --
> Regards,
> 
> Laurent Pinchart
>
Stefan Klug May 18, 2026, 8:22 a.m. UTC | #2
Hi Laurent,

Thank you for the patch.

Quoting Laurent Pinchart (2026-05-16 22:29:12)
> Job definitions in .gitlab-ci.yml are stored by Gitlab in jobs. This
> means that a new full pipeline needs to be run when making a change to
> the job, as re-running a failed job will not pick up changes to the job
> definition.
> 
> To avoid this and help with development, move the ssh configuration
> script to the deploy-libcamera-docs.sh file. As the libcamera-ci
> repository is cloned freshly every time a job is run, changes to the
> script can be tested just by re-running the job.

I actually kept the ssh part out of the script on purpose so that it would be
easier to test the script locally out of the gitlab ci context. But in
the end I don't care too much.

> 
> While at it, fix indentation in the rsync command.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>

Regards,
Stefan

> ---
>  .gitlab-ci/deploy-libcamera-docs.sh | 16 +++++++++++-----
>  gitlab-ci.yml                       |  7 -------
>  2 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/.gitlab-ci/deploy-libcamera-docs.sh b/.gitlab-ci/deploy-libcamera-docs.sh
> index 639fdf748d07..d25c8275adf5 100755
> --- a/.gitlab-ci/deploy-libcamera-docs.sh
> +++ b/.gitlab-ci/deploy-libcamera-docs.sh
> @@ -12,12 +12,18 @@ source "$(dirname "$0")/lib.sh"
>  libcamera_deploy_docs() {
>         echo "Deploying libcamera docs for ${CI_COMMIT_REF_NAME}"
>  
> +       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 -
> +
>         rsync -rlz --delete --chmod=Do=rx,Fo=r \
> -          --exclude .doctrees \
> -          --exclude .buildinfo \
> -          --exclude objects.inv \
> -          docs/ \
> -          "${DEPLOY_DESTINATION}/${CI_COMMIT_REF_NAME}"
> +               --exclude .doctrees \
> +               --exclude .buildinfo \
> +               --exclude objects.inv \
> +               docs/ \
> +               "${DEPLOY_DESTINATION}/${CI_COMMIT_REF_NAME}"
>  }
>  
>  run libcamera_deploy_docs
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index e3274ca56e20..427f2d2516dc 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -461,11 +461,4 @@ deploy-docs:
>    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
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/.gitlab-ci/deploy-libcamera-docs.sh b/.gitlab-ci/deploy-libcamera-docs.sh
index 639fdf748d07..d25c8275adf5 100755
--- a/.gitlab-ci/deploy-libcamera-docs.sh
+++ b/.gitlab-ci/deploy-libcamera-docs.sh
@@ -12,12 +12,18 @@  source "$(dirname "$0")/lib.sh"
 libcamera_deploy_docs() {
 	echo "Deploying libcamera docs for ${CI_COMMIT_REF_NAME}"
 
+	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 -
+
 	rsync -rlz --delete --chmod=Do=rx,Fo=r \
-          --exclude .doctrees \
-          --exclude .buildinfo \
-          --exclude objects.inv \
-          docs/ \
-          "${DEPLOY_DESTINATION}/${CI_COMMIT_REF_NAME}"
+		--exclude .doctrees \
+		--exclude .buildinfo \
+		--exclude objects.inv \
+		docs/ \
+		"${DEPLOY_DESTINATION}/${CI_COMMIT_REF_NAME}"
 }
 
 run libcamera_deploy_docs
diff --git a/gitlab-ci.yml b/gitlab-ci.yml
index e3274ca56e20..427f2d2516dc 100644
--- a/gitlab-ci.yml
+++ b/gitlab-ci.yml
@@ -461,11 +461,4 @@  deploy-docs:
   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