From: Claudius Heine <[email protected]>

Signed-off-by: Claudius Heine <[email protected]>
---
 .travis-build.sh | 32 ++++++++++++++++++++++++++++++--
 .travis.yml      | 13 +++++++++++++
 2 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/.travis-build.sh b/.travis-build.sh
index cb2e250..fb26660 100755
--- a/.travis-build.sh
+++ b/.travis-build.sh
@@ -2,7 +2,21 @@
 
 set -euo pipefail
 
-TARGET="${TARGET-"$1"}"
+PARAM="${PARAM-"${1-""}"}"
+TARGET="${TARGET-""}"
+
+COVERITY_SCAN_BRANCH="${COVERITY_SCAN_BRANCH:-"0"}"
+if [ "$COVERITY_SCAN_BRANCH" == "1" ]
+then
+    if [ "$TARGET" == "native" ]
+    then
+        TARGET_EFFECTIVE="${PARAM:-"success"}"
+    else
+        TARGET_EFFECTIVE="success"
+    fi
+else
+    TARGET_EFFECTIVE="${PARAM:-"${TARGET}"}"
+fi
 
 prepare_build()
 {
@@ -32,7 +46,7 @@ install_cppcheck()
     rm -rf cppcheck
 }
 
-case "$TARGET" in
+case "$TARGET_EFFECTIVE" in
     native)
         prepare_build
         enter_build
@@ -88,6 +102,20 @@ case "$TARGET" in
         exec cppcheck -f -q --error-exitcode=2 --std=posix \
             $enable $suppress $cpp_conf $includes .
         ;;
+    coverity_prepare)
+        prepare_build
+        enter_build
+        ../configure
+        exit 0
+        ;;
+    coverity_build)
+        enter_build
+        exec make
+        ;;
+    success)
+        echo "Skipping $TARGET" >&2
+        exit 0
+        ;;
     *)
         exit -1
         ;;
diff --git a/.travis.yml b/.travis.yml
index 4fa4045..af6e354 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,11 +22,24 @@ compiler:
 
 sudo: required
 
+before_install:
+      - echo -n | openssl s_client -connect scan.coverity.com:444 | sed -ne 
'/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a 
/etc/ssl/certs/ca-certificates.crt
+
 install:
   - sudo apt-get install gcc-multilib gnu-efi libpci-dev libz-dev:i386
   - sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu xenial 
universe'
   - sudo apt-get update -qq
   - sudo apt-get install --no-install-recommends --target-release xenial 
libcmocka-dev
 
+addons:
+  coverity_scan:
+    project:
+      name: "siemens/efibootguard"
+      description: "Build submitted via Travis CI"
+    notification_email: [email protected]
+    build_command_prepend: "./.travis-build.sh coverity_prepare"
+    build_command: "./.travis-build.sh coverity_build"
+    branch_pattern: coverity_scan
+
 script:
   - ./.travis-build.sh
-- 
2.14.1

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/20170928074358.1110-3-claudius.heine.ext%40siemens.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to