jjb: Add env and os details printing to build jobs
[lttng-ci.git] / scripts / lttng-tools / gerrit-depends-on.sh
index 4003dfc1fb164183e46df22c71dbd99b29cffb8b..b8bcd4e9a30d6b07da061534bcaa6adbf7918c30 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash -exu
+#!/bin/bash
 # shellcheck disable=SC2103
 #
 # Copyright (C) 2020 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+set -exu
+
 #Required variables
 GERRIT_NAME=${GERRIT_NAME:-}
 WORKSPACE=${WORKSPACE:-}
@@ -25,7 +27,7 @@ gerrit_url="https://${GERRIT_NAME}"
 gerrit_query="?o=CURRENT_REVISION&o=DOWNLOAD_COMMANDS"
 gerrit_json_query=".revisions[.current_revision].ref"
 
-possible_depends_on="lttng-ust"
+possible_depends_on="lttng-ust|lttng-modules"
 re="Depends-on: (${possible_depends_on}): ([^'$'\n'']*)"
 property_file="${WORKSPACE}/gerrit_custom_dependencies.properties"
 
@@ -55,6 +57,17 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do
         continue
     fi
 
+    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
+            rm -rf "$WORKSPACE/src/lttng-modules"
+        else
+            # This job does not require modules sources
+            continue
+       fi
+    fi
+
     # Export the GERRIT_DEP_... into the property file for further jenkins usage
     echo "GERRIT_DEP_${project_sanitize^^}=${gerrit_id}" >> "$property_file"
 
This page took 0.028849 seconds and 4 git commands to generate.