-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile-cop-noplugin-docker
More file actions
41 lines (40 loc) · 1.35 KB
/
Jenkinsfile-cop-noplugin-docker
File metadata and controls
41 lines (40 loc) · 1.35 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
38
39
40
41
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 {
docker {
image 'maven:3-jdk-11'
args '-v $HOME/.m2:/home/build/.m2 -v $HOME/.synopsys:/home/build/.synopsys'
}
}
environment {
POLARIS_HOME = '/home/build/.synopsys'
JAVA_TOOL_OPTIONS = '-Duser.home=/home/build'
}
stages {
stage('checkout') {
steps {
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 analyze -w -- $BLDCMD
"""
}
}
}
}
post {
always {
archiveArtifacts artifacts: '.synopsys/polaris/configuration/synopsys.yml, .synopsys/polaris/data/coverity/*/idir/build-log.txt'
cleanWs()
}
}
}