From: Kienan Stewart Date: Wed, 3 Jul 2024 19:18:47 +0000 (-0400) Subject: jjb: Use lttng-modules from gerrit when depends-on is set X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=1dee97eb1cf4c7ac3242d604d33a1f72475e4816;p=lttng-ci.git jjb: Use lttng-modules from gerrit when depends-on is set Change-Id: Id9727687db2ebde04a4c564cdbac400c3c95652f Signed-off-by: Kienan Stewart --- diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index 8857515..93a83e2 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -236,11 +236,17 @@ - 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 diff --git a/scripts/lttng-tools/gerrit-depends-on.sh b/scripts/lttng-tools/gerrit-depends-on.sh index 9e607bf..e568578 100755 --- a/scripts/lttng-tools/gerrit-depends-on.sh +++ b/scripts/lttng-tools/gerrit-depends-on.sh @@ -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