]> git.lttng.org Git - lttng-ci.git/commitdiff
jjb: babeltrace: git untracked on review jobs only
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 14 Jan 2025 22:52:30 +0000 (17:52 -0500)
committerMichael Jeanson <mjeanson@efficios.com>
Tue, 14 Jan 2025 23:05:38 +0000 (18:05 -0500)
Enable the git untracked files check on review jobs only as it breaks
multiple release branch jobs.

I also want to enable this check on 'master' branches but this will
require a more intrusive change that I'll do in another patch.

Change-Id: I4fcd48ca50466e000e7ef919b804d5e6362c6ade
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
jobs/babeltrace.yaml
scripts/babeltrace/build.sh

index 0eac519b9624eb77870989d5d6a7708465f9302a..8be55c8320f6139970ee79a918c7322209374cd2 100644 (file)
       - inject:
           properties-content: |
             PROJECT_NAME=babeltrace
+            BABELTRACE_GIT_UNTRACKED=yes
       - build-discarder:
           days-to-keep: 1
       - throttle:
           properties-content: |
             PROJECT_NAME=babeltrace
             BABELTRACE_RUN_TESTS=no
+            BABELTRACE_GIT_UNTRACKED=yes
       - build-discarder:
           days-to-keep: 1
 
index 4ce38ac7294e909fd6ee3eceae04997747d1b10d..120d46cedbbf93332943a69fab0e1ead4a7fbdb1 100755 (executable)
@@ -131,6 +131,7 @@ cc=${cc:-}
 BABELTRACE_MAKE_INSTALL="${BABELTRACE_MAKE_INSTALL:-yes}"
 BABELTRACE_MAKE_CLEAN="${BABELTRACE_MAKE_CLEAN:-yes}"
 BABELTRACE_GEN_COMPILE_COMMANDS="${BABELTRACE_GEN_COMPILE_COMMANDS:-no}"
+BABELTRACE_GIT_UNTRACKED="${BABELTRACE_GIT_UNTRACKED:-no}"
 BABELTRACE_RUN_TESTS="${BABELTRACE_RUN_TESTS:-yes}"
 BABELTRACE_CLANG_TIDY="${BABELTRACE_CLANG_TIDY:-no}"
 
@@ -468,20 +469,22 @@ if [ "$BABELTRACE_RUN_TESTS" = "yes" ]; then
     rsync -a --include 'test-suite.log' --include '*/' --exclude='*' tests/ "$WORKSPACE/log"
 fi
 
-# Check that the git repository has no untracked files, meaning that
-# .gitignore is not missing anything.
-pushd "$SRCDIR"
-
-git_status_output=$(git status --short)
-if [ -n "$git_status_output" ]; then
-    echo "Error: There are untracked or modified files in the repository:"
-    echo "git_status_output"
-    exit_status=1
-else
-    echo "No untracked or modified files."
-fi
+if [ "$BABELTRACE_GIT_UNTRACKED" = "yes" ]; then
+    # Check that the git repository has no untracked files, meaning that
+    # .gitignore is not missing anything.
+    pushd "$SRCDIR"
 
-popd
+    git_status_output=$(git status --short)
+    if [ -n "$git_status_output" ]; then
+        echo "Error: There are untracked or modified files in the repository:"
+        echo "git_status_output"
+        exit_status=1
+    else
+        echo "No untracked or modified files."
+    fi
+
+    popd
+fi
 
 # Clean the build directory
 if [ "$BABELTRACE_MAKE_CLEAN" = "yes" ]; then
This page took 0.028034 seconds and 4 git commands to generate.