Add coverity to liburcu
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 2 Sep 2015 21:01:33 +0000 (17:01 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Wed, 2 Sep 2015 21:01:33 +0000 (17:01 -0400)
.gitignore
jobs/liburcu.yaml
scripts/common/coverity.sh

index 57d178eb859671b056846ebe85f72222d6b93c43..64cf77f81461d9536a0a467f3112185a8ddd5427 100644 (file)
@@ -1,3 +1,3 @@
 test/
-.venv/
+.venv*/
 etc/jenkins_jobs.ini
index c08e55243e1d681684eb38cd54a3e5a9024f3334..3935532e704e1fe6662abd99b33856b6d2082805 100644 (file)
@@ -36,7 +36,8 @@
     wrappers:
       - workspace-cleanup
       - timestamps
-      - ansicolor
+      - ansicolor:
+          colormap: xterm
 
     scm:
       - git:
@@ -47,7 +48,8 @@
             - origin/{version}
 
     triggers:
-      - pollscm: "@hourly"
+      - pollscm:
+          cron: "@hourly"
 
     properties:
       - github:
@@ -87,7 +89,7 @@
       - warnings:
           console-log-parsers:
             - 'GNU Make + GNU C Compiler (gcc)'
-          total-thresholds:
+          #total-thresholds:
             #failed:
             #  total-all: 0
             #  total-high: 0
     defaults: liburcu
 
     triggers:
-      - pollscm: "@daily"
+      - pollscm:
+          cron: "@daily"
 
     builders:
       - shell: |
     node: 'x86-64'
 
     triggers:
-      - pollscm: "@daily"
+      - pollscm:
+          cron: "@daily"
 
     builders:
       - shell:
           dir: 'scan-build-archive/'
           files: 'index.html'
 
-# TODO: liburcu_{version}_coverity
+- job-template:
+    name: liburcu_{version}_coverity
+    defaults: liburcu
+    node: 'x86-64'
+
+    triggers:
+      - pollscm:
+          cron: "@daily"
+
+    wrappers:
+      - workspace-cleanup
+      - timestamps
+      - ansicolor:
+          colormap: xterm
+      - credentials-binding:
+          - username-password-separated:
+              credential-id: liburcu_coverity_token
+              username: COVERITY_SCAN_PROJECT_NAME
+              password: COVERITY_SCAN_TOKEN
+
+    builders:
+      - shell:
+          !include-raw-escape scripts/common/coverity.sh
+
+    publishers:
+      - workspace-cleanup
 
 
 ## Project
           build: !!python/tuple [std]
       - 'liburcu_{version}_cppcheck'
       - 'liburcu_{version}_scan-build'
+      - 'liburcu_{version}_coverity':
+          version: master
 
index 0c7848f6931848ca0db4f298df26390be5f7c73a..18d4fd5ce46b35b9a9b1b4cafea86ac3fafdf7e8 100644 (file)
@@ -17,6 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Coverity settings
+# The project name and token have to be provided trough env variables
 #COVERITY_SCAN_PROJECT_NAME=""
 #COVERITY_SCAN_TOKEN=""
 COVERITY_SCAN_VERSION=`git describe --always | sed 's|-|.|g'`
@@ -62,7 +63,9 @@ fi
 
 
 # Verify upload is permitted
+set +x
 AUTH_RES=`curl -s --form project="$COVERITY_SCAN_PROJECT_NAME" --form token="$COVERITY_SCAN_TOKEN" $SCAN_URL/api/upload_permitted`
+set -x
 if [ "$AUTH_RES" = "Access denied" ]; then
   echo -e "\033[33;1mCoverity Scan API access denied. Check COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN.\033[0m"
   exit 1
@@ -82,7 +85,9 @@ fi
 if [ ! -d $TOOL_BASE ]; then
   if [ ! -e $TOOL_ARCHIVE ]; then
     echo -e "\033[33;1mDownloading Coverity Scan Analysis Tool...\033[0m"
+    set +x
     wget -nv -O $TOOL_ARCHIVE $TOOL_URL --post-data "project=$COVERITY_SCAN_PROJECT_NAME&token=$COVERITY_SCAN_TOKEN"
+    set -x
   fi
 
   # Extract Coverity Scan Analysis Tool
@@ -116,6 +121,7 @@ tar czf $RESULTS_ARCHIVE $RESULTS_DIR
 
 # Upload results
 echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m"
+set +x
 response=$(curl \
   --silent --write-out "\n%{http_code}\n" \
   --form project=$COVERITY_SCAN_PROJECT_NAME \
@@ -125,6 +131,7 @@ response=$(curl \
   --form version=$COVERITY_SCAN_VERSION \
   --form description=$COVERITY_SCAN_DESCRIPTION \
   $UPLOAD_URL)
+set -x
 status_code=$(echo "$response" | sed -n '$p')
 if [ "$status_code" != "201" ]; then
   TEXT=$(echo "$response" | sed '$d')
This page took 0.025799 seconds and 4 git commands to generate.