diff mbox series

[kirkstone,4/6] CI: don't run update-repos if KAS_REPO_REF_DIR isn't set

Message ID 20250627134946.154438-4-ross.burton@arm.com
State New
Headers show
Series [kirkstone,1/6] CI: add CI_CLEAN_REPOS variable to allow cleaning the repo reference cache | expand

Commit Message

Ross Burton June 27, 2025, 1:49 p.m. UTC
Mostly taken from master.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .gitlab-ci.yml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2a07ea08be..ef75a45bba 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -76,8 +76,16 @@  update-repos:
   extends: .setup
   stage: prep
   script:
-    - flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
+    - |
+      exit_code=0
 
+      if [ -n "$KAS_REPO_REF_DIR" ]; then
+        flock --verbose --timeout 60 $KAS_REPO_REF_DIR --command ./ci/update-repos || exit_code=$?
+        # Exit now if that failed, unless the status was 128 (fetch failed)
+        test $exit_code != 0 -a $exit_code != 128 && exit 1
+      fi
+
+      exit $exit_code
 #
 # Build stage, the actual build jobs
 #