forked from chuckaude/hello-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.declarative
41 lines (41 loc) · 1022 Bytes
/
Jenkinsfile.declarative
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
39
40
41
pipeline {
agent any
environment {
PROJECT = 'hello-c'
STREAM = 'hello-c'
IDIR = 'idir'
}
stages {
stage('build') {
steps {
withCoverityEnv(coverityToolName: 'latest', connectInstance: 'localhost') {
sh "cov-build --dir ${IDIR} make all"
}
}
}
stage('analyze') {
steps {
withCoverityEnv(coverityToolName: 'latest', connectInstance: 'localhost') {
sh "cov-analyze --dir ${IDIR} --strip-path ${WORKSPACE} --all --enable-callgraph-metrics --enable-fnptr --enable-virtual"
}
}
}
stage('commit') {
steps {
withCoverityEnv(coverityToolName: 'latest', connectInstance: 'localhost') {
sh "cov-commit-defects --dir ${IDIR} --host ${COVERITY_HOST} --stream ${STREAM} --scm git --description ${BUILD_TAG} --target Linux_x86_64 --version ${GIT_COMMIT}"
}
}
}
stage('results') {
steps {
coverityResults connectInstance: 'localhost', connectView: 'Outstanding Issues', projectId: "${PROJECT}"
}
}
}
post {
always {
deleteDir()
}
}
}