summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build-gluster-org/jobs/coverity.yml36
-rw-r--r--build-gluster-org/scripts/coverity.sh34
2 files changed, 70 insertions, 0 deletions
diff --git a/build-gluster-org/jobs/coverity.yml b/build-gluster-org/jobs/coverity.yml
new file mode 100644
index 0000000..b206f03
--- /dev/null
+++ b/build-gluster-org/jobs/coverity.yml
@@ -0,0 +1,36 @@
+- job:
+ name: coverity-nightly
+ node: coverity
+ description: Trigger a coverity run once a week
+ project-type: freestyle
+ concurrent: true
+
+ scm:
+ - git:
+ branches:
+ - origin/master
+ url: git://review.gluster.org/glusterfs.git
+ wipe-workspace: true
+
+ properties:
+ - discard-after-x:
+ x: 90
+ - one-build-per-node
+
+ triggers:
+ - timed: "H 14 * * *"
+
+ builders:
+ - shell: !include-raw: ../scripts/coverity.sh
+
+ wrappers:
+ - timestamps
+ - timeout:
+ timeout: 30
+ abort: true
+ type: absolute
+ - credentials-binding:
+ - username-password-separated:
+ credential-id: ce387678-f75f-49c7-a64e-b69bddc9b4ee
+ username: COVERITY_EMAIL
+ password: COVERITY_TOKEN
diff --git a/build-gluster-org/scripts/coverity.sh b/build-gluster-org/scripts/coverity.sh
new file mode 100644
index 0000000..6b72191
--- /dev/null
+++ b/build-gluster-org/scripts/coverity.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+./autogen.sh
+./configure --enable-gnfs --enable-debug --silent
+nproc=$(getconf _NPROCESSORS_ONLN)
+
+# This is a hack to get Coverity to work with GCC8, all of them may not be
+# needed in EL7 at the moment, but if someone wants to do this on Fedora, these
+# are the steps
+cat <<EOF >> site.h
+#ifndef __COVERITY_GCC_VERSION_AT_LEAST
+ #define __COVERITY_GCC_VERSION_AT_LEAST(x, y) 0
+ #define FAKE__COVERITY_GCC_VERSION_AT_LEAST__
+#endif /* __COVERITY_GCC_VERSION_AT_LEAST */
+#ifdef __x86_64__
+ #if __COVERITY_GCC_VERSION_AT_LEAST(7, 0)
+ typedef float _Float128 __attribute__((__vector_size__(128)));
+ typedef float _Float32 __attribute__((__vector_size__(32)));
+ typedef float _Float32x __attribute__((__vector_size__(32)));
+ typedef float _Float64 __attribute__((__vector_size__(64)));
+ typedef float _Float64x __attribute__((__vector_size__(64)));
+ #endif
+#endif
+EOF
+/opt/cov-analysis-linux64-2017.07/bin/cov-build --dir cov-int make -j ${nproc};
+tar czvf glusterfs.tgz cov-int
+BUILD_DATE=$(date "+%Y-%m-%d")
+BUILD_VERSION=$(git log -n1 --pretty='%h')
+curl --form token="${COVERITY_TOKEN}" \
+ --form email="${COVERITY_EMAIL}" \
+ --form file=@glusterfs.tgz \
+ --form version="${BUILD_DATE}-${BUILD_VERSION}" \
+ --form description="Nightly build on ${BUILD_DATE}" \
+ https://scan.coverity.com/builds?project=gluster%2Fglusterfs