jjb: Use lttng-modules from gerrit when depends-on is set
authorKienan Stewart <kstewart@efficios.com>
Wed, 3 Jul 2024 19:18:47 +0000 (15:18 -0400)
committerKienan Stewart <kstewart@efficios.com>
Wed, 3 Jul 2024 19:18:47 +0000 (15:18 -0400)
Change-Id: Id9727687db2ebde04a4c564cdbac400c3c95652f
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
jobs/lttng-tools.yaml
scripts/lttng-tools/gerrit-depends-on.sh

index 88575157eb448c319c078ed91e7be62d09fb6edb..93a83e2ff8710f789535d68f950f6388d5ade2ab 100644 (file)
       - inject:
           properties-file: gerrit_custom_dependencies.properties
 
-      # rootbuild requires a checkout of modules
+      # rootbuild requires a checkout of modules, but only
+      # when we don't depend on a specific lttng-modules change
       - conditional-step:
-          condition-kind: regex-match
-          label: '$JOB_NAME'
-          regex: '.*_root(?:_[a-z]+)?build.*'
+          condition-kind: and
+          on-evaluation-failure: run
+          condition-operands:
+            - condition-kind: shell
+              condition-command: 'test "$GERRIT_DEP_LTTNG_MODULES" = ""'
+            - condition-kind: regex-match
+              label: '$JOB_NAME'
+              regex: '.*_root(?:_[a-z]+)?build.*'
           steps:
             - shell: |
                 #!/bin/bash
index 9e607bf257d5efbc7e6389fb030f588ef3e808e3..e568578a3c99e2fc05e573fce8758c744058cb2d 100755 (executable)
@@ -61,12 +61,9 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do
     if [ "$project" = "lttng-modules" ]; then
         if [ -d "$WORKSPACE/src/lttng-modules" ]; then
             # Remove the regular modules sources to replace them with those
-           # from the gerrit change
+            # from the gerrit change
             rm -rf "$WORKSPACE/src/lttng-modules"
-        else
-            # This job does not require modules sources
-            continue
-       fi
+        fi
     fi
 
     # Export the GERRIT_DEP_... into the property file for further jenkins usage
This page took 0.026492 seconds and 4 git commands to generate.