forked from chuckaude/hello-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.noplugin
38 lines (38 loc) · 962 Bytes
/
Jenkinsfile.noplugin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
pipeline {
agent any
environment {
COVBIN = '/opt/coverity/analysis/latest/bin'
COVHOST = 'localhost'
AUTHKEY = '${JENKINS_HOME}/.coverity/authkeys/ak-localhost-8080'
PROJECT = 'hello-c'
STREAM = 'hello-c'
IDIR = 'idir'
}
stages {
stage('build') {
steps {
sh "${COVBIN}/cov-build --dir ${IDIR} make all"
}
}
stage('analyze') {
steps {
sh "${COVBIN}/cov-analyze --dir ${IDIR} --strip-path ${WORKSPACE} --all --enable-callgraph-metrics --enable-fnptr --enable-virtual"
}
}
stage('commit') {
steps {
sh "${COVBIN}/cov-commit-defects --dir ${IDIR} --host ${COVHOST} --auth-key-file ${AUTHKEY} --stream ${STREAM} --scm git --description ${BUILD_TAG} --target Linux_x86_64 --version ${GIT_COMMIT}"
}
}
stage('results') {
steps {
sh "${COVBIN}/cov-manage-im --host ${COVHOST} --auth-key-file ${AUTHKEY} --mode defects --project ${PROJECT} --show"
}
}
}
post {
always {
deleteDir()
}
}
}