-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile-cop-noplugin
More file actions
37 lines (36 loc) · 1.22 KB
/
Jenkinsfile-cop-noplugin
File metadata and controls
37 lines (36 loc) · 1.22 KB
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
def GIT_REPO = 'https://github.com/chuckaude/hello-java.git'
def BRANCH = 'main'
def PROJECT = 'chuckaude-hello-java'
def BLDCMD = 'mvn -B package -DskipTests'
pipeline {
agent { label 'linux64' }
tools {
maven 'maven-3.9'
jdk 'openjdk-17'
}
stages {
stage('checkout') {
steps {
cleanWs()
git url: "$GIT_REPO", branch: "$BRANCH", credentialsId: 'github-chuckaude'
}
}
stage('polaris') {
steps {
withCredentials([string(credentialsId: 'polaris-sipse', variable: 'POLARIS_ACCESS_TOKEN')]) {
sh """
curl -fLOsS $POLARIS_SERVER_URL/api/tools/polaris_cli-linux64.zip
unzip -d /tmp -jo polaris_cli-linux64.zip && rm -f polaris_cli-linux64.zip
/tmp/polaris --co project.name=$PROJECT --co capture.build.cleanCommands='null' analyze -w -- $BLDCMD
"""
}
}
}
}
post {
always {
archiveArtifacts artifacts: '.synopsys/polaris/configuration/synopsys.yml, .synopsys/polaris/data/coverity/*/idir/build-log.txt'
cleanWs()
}
}
}