-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile_old
More file actions
55 lines (54 loc) · 1.72 KB
/
Jenkinsfile_old
File metadata and controls
55 lines (54 loc) · 1.72 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pipeline {
agent {
docker {
image 'eddevopsd2/maven-java-npm-docker:mvn3.6.3-jdk8-npm6.14.4-docker'
args '-v /root/.m2/Qlack-WebDesktop:/root/.m2'
}
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10'))
}
stages {
stage('Build') {
steps {
sh 'mvn clean install'
}
}
stage('Sonar Analysis') {
steps {
withSonarQubeEnv('sonar'){
sh 'update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java'
sh 'mvn sonar:sonar -Dsonar.projectName=Qlack-WebDesktop -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_KEY_QLACKWD}'
}
}
}
stage('Produce bom.xml'){
steps{
sh 'mvn org.cyclonedx:cyclonedx-maven-plugin:makeAggregateBom'
}
}
stage('Dependency-Track Analysis'){
steps{
sh '''
cat > payload.json <<__HERE__
{
"project": "0ef45e1f-b251-4427-9769-9ed83ef35d03",
"bom": "$(cat target/bom.xml |base64 -w 0 -)"
}
__HERE__
'''
sh '''
curl -X "PUT" ${DEPENDENCY_TRACK_URL} -H 'Content-Type: application/json' -H 'X-API-Key: '${DEPENDENCY_TRACK_API_KEY} -d @payload.json
'''
}
}
}
post {
changed {
emailext subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
to: 'qlack@eurodyn.com'
}
}
}