This is an automated email from the ASF dual-hosted git repository.

bnolsen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git


The following commit(s) were added to refs/heads/main by this push:
     new ff74ade  add coverity preset
     new 8f9ab4e  Merge pull request #261 from traeak/cmake_fixes
ff74ade is described below

commit ff74ade6bc620a1f7d9dc70a3627a1853f463b51
Author: Brian Olsen <[email protected]>
AuthorDate: Wed Oct 25 11:14:11 2023 -0600

    add coverity preset
---
 jenkins/bin/in_tree.sh           | 18 +++++-----
 jenkins/bin/out_of_tree.sh       | 20 ++++++-----
 jenkins/branch/CMakePresets.json | 12 +++++++
 jenkins/branch/coverity.pipeline | 73 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 106 insertions(+), 17 deletions(-)

diff --git a/jenkins/bin/in_tree.sh b/jenkins/bin/in_tree.sh
index a859e65..77ad498 100755
--- a/jenkins/bin/in_tree.sh
+++ b/jenkins/bin/in_tree.sh
@@ -22,16 +22,18 @@ set -x
 
 cd "${WORKSPACE}/src"
 
-autoreconf -fi
-./configure \
+if [ -d cmake ]
+then
+       echo "Not supported under cmake"
+else
+       echo "autotools build"
+       autoreconf -fi
+       ./configure \
     --with-user=jenkins \
     --enable-ccache \
     --enable-werror \
     --enable-wccp
 
-#    --enable-experimental-plugins \
-#    --enable-example-plugins \
-
-${ATS_MAKE} ${ATS_MAKE_FLAGS} V=1
-#${ATS_MAKE} check VERBOSE=Y
-${ATS_MAKE} clean
+       ${ATS_MAKE} ${ATS_MAKE_FLAGS} V=1
+       ${ATS_MAKE} clean
+fi
diff --git a/jenkins/bin/out_of_tree.sh b/jenkins/bin/out_of_tree.sh
index 7c57a95..5c611b1 100755
--- a/jenkins/bin/out_of_tree.sh
+++ b/jenkins/bin/out_of_tree.sh
@@ -22,17 +22,19 @@ set -x
 
 cd "${WORKSPACE}/src"
 
-autoreconf -fi
-mkdir -p BUILDS && cd BUILDS
-../configure \
+if [ -d cmake ]
+then
+       echo "not supported under cmake"
+else
+       echo "autotools build"
+       autoreconf -fi
+       mkdir -p BUILDS && cd BUILDS
+       ../configure \
     --with-user=jenkins \
     --enable-ccache \
     --enable-werror \
     --enable-wccp
 
-#    --enable-experimental-plugins \
-#    --enable-example-plugins \
-
-${ATS_MAKE} -j5 V=1
-#${ATS_MAKE} check VERBOSE=Y
-${ATS_MAKE} clean
+       ${ATS_MAKE} -j5 V=1
+       ${ATS_MAKE} clean
+fi
diff --git a/jenkins/branch/CMakePresets.json b/jenkins/branch/CMakePresets.json
index debfe8d..d963b8c 100644
--- a/jenkins/branch/CMakePresets.json
+++ b/jenkins/branch/CMakePresets.json
@@ -112,6 +112,18 @@
         "BUILD_EXPERIMENTAL_PLUGINS": "ON",
         "ENABLE_EXAMPLE": "ON"
       }
+    },
+    {
+      "name": "coverity",
+      "displayName": "coverity defaults",
+      "description": "Defaults for coverity builds",
+      "generator": "Unix Makefiles",
+      "binaryDir": "${sourceDir}/build",
+      "cacheVariables": {
+        "CMAKE_BUILD_TYPE": "Debug",
+        "BUILD_EXPERIMENTAL_PLUGINS": "ON",
+        "ENABLE_EXAMPLE": "ON"
+      }
     }
   ]
 }
diff --git a/jenkins/branch/coverity.pipeline b/jenkins/branch/coverity.pipeline
new file mode 100644
index 0000000..bec8922
--- /dev/null
+++ b/jenkins/branch/coverity.pipeline
@@ -0,0 +1,73 @@
+pipeline {
+       agent {
+               docker {
+                       registryUrl 'https://ci.trafficserver.apache.org/'
+                       image 'ci.trafficserver.apache.org/ats/rockylinux:8'
+                       args '--init --cap-add=SYS_PTRACE --network=host -v 
${HOME}/ccache:/tmp/ccache:rw'
+                       label 'branch'
+               }
+       }
+
+       environment {
+               CCACHE_DIR = "/tmp/ccache"
+       }
+       
+       stages {
+               stage('Initialization') {
+                       steps {
+                               dir('src') {
+                                       sh '''#!/bin/bash
+                                               set +x
+                                               rm -rf *
+                                               set -x
+                                       '''
+                                       git 
'https://github.com/apache/trafficserver.git'
+                                       sh '''#!/bin/bash
+                                               set +x
+                                               rm -rf cov_tools
+                                               rm -rf cov-int
+                                               mkdir cov_tools
+                                               wget 
https://scan.coverity.com/download/linux64 \
+                                                       --post-data 
"token=SCRUBBED&project=Apache+Traffic+Server" \
+                                                       -O coverity_tool.tgz
+                                               tar -xvzf coverity_tool.tgz -C 
cov_tools --strip-components 1
+                                               set -x
+
+                                               if [ -d cmake ]
+                                               then
+                                                       
presetpath="../ci/jenkins/branch/CMakePresets.json"
+                                                       [ -f "${presetpath}" ] 
&& cp -f "${presetpath}" .
+                                                       cmake -B . --preset 
coverity
+                                               else
+                                                       autoreconf -fiv
+                                                       ./configure \
+                                                               
--enable-experimental-plugins \
+                                                               
--enable-example-plugins
+                                               fi
+
+                                               ./cov_tools/bin/cov-build --dir 
cov-int make -j`nproc`
+
+                                               tar czvf trafficserver.tgz 
cov-int
+
+                                               set +x
+                                               curl \
+                                                       --form token=SCRUBBED \
+                                                       --form email=SCRUBBED \
+                                                       --form 
file=@./trafficserver.tgz \
+                                                       --form 
version="master-$(date +"%Y%m%d")" \
+                                                       --form 
description="master-$(date +"%Y%m%d")" \
+                                                       
https://scan.coverity.com/builds?project=Apache+Traffic+Server
+                                               set -x
+
+                                               if [ -d cmake ]
+                                                       rm -rf build
+                                               then
+                                               else
+                                                       make distclean
+                                               fi
+                                       '''
+                               }
+                       }
+               }
+       }
+}

Reply via email to