]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
ci: Select single configuration for Coverity scan via branch name
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 6 Feb 2015 20:08:48 +0000 (21:08 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Sat, 7 Feb 2015 09:17:15 +0000 (10:17 +0100)
As scan results of generic files are overwritten with the last
configuration build, allow to pick a specific config for stand-alone
analysis. This comes at the price of overwriting results on the project
page but is still better than missing something subtle.

To differentiate the snapshot in Coverity, patch the description that is
attached to the upload.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
.travis.yml
ci/build-all-configs.sh
ci/coverity-scan-build.sh

index d7110df2de5874066bbef64960180c92e426a001..618ce80ef44fdf59714bca4a2205bb4803e508bf 100644 (file)
@@ -43,4 +43,4 @@ addons:
     build_script_url: https://raw.githubusercontent.com/$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/ci/coverity-scan-build.sh
     build_command_prepend: "cov-configure --comptype gcc --compiler arm-linux-gnueabihf-gcc --template"
     build_command: "unused"
-    branch_pattern: coverity_scan
+    branch_pattern: coverity_scan.*
index 8c5ca6e5bbd35b969a279caf5543d2ffb0233949..92207d7f14170bda0fad26870569b8681cf2b45e 100755 (executable)
 
 CONFIGS="x86 banana-pi vexpress"
 
+# only build a specific config if the branch selects it
+if [ ${TRAVIS_BRANCH#coverity_scan-} != ${TRAVIS_BRANCH} ]; then
+       CONFIGS=${TRAVIS_BRANCH#coverity_scan-}
+fi
+
 PREFIX=
 if [ "$1" == "--cov" ]; then
        export COVERITY_UNSUPPORTED=1
index b4f0d629bd8567a597319b33f8c50aac8abb058c..72e0486d779d959d28e4febdeb3b6dd533bf938a 100644 (file)
@@ -17,10 +17,16 @@ curl -s https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh \
 # Patch the line that starts the build.
 # We need to control this step via our build script.
 sed 's/^COVERITY_UNSUPPORTED=1 cov-build --dir.*/ci\/build-all-configs.sh --cov \$RESULTS_DIR \$COV_BUILD_OPTIONS/' \
-       ci/travisci_build_coverity_scan.sh.orig > ci/travisci_build_coverity_scan.sh
+       ci/travisci_build_coverity_scan.sh.orig > ci/travisci_build_coverity_scan.sh.step1
+
+# Path the branch name into the description.
+sed 's/^  --form description=.*/  --form description="Travis CI build (branch: \$TRAVIS_BRANCH)" \\/' \
+       ci/travisci_build_coverity_scan.sh.step1 > ci/travisci_build_coverity_scan.sh
 
 # Check if the patch applied, bail out if not.
 if diff -q ci/travisci_build_coverity_scan.sh.orig \
+          ci/travisci_build_coverity_scan.sh.step1 > /dev/null || \
+   diff -q ci/travisci_build_coverity_scan.sh.step1 \
           ci/travisci_build_coverity_scan.sh > /dev/null; then
        echo "Unable to patch Coverity script!"
        exit 1