[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 New
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(-)

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