forked from ShiftLeftSecurity/shiftleft-java-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
87 lines (75 loc) · 1.9 KB
/
Jenkinsfile
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
pipeline {
agent any
stages {
stage('Build') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
mvn clean package -B
'''
}
}
stage('Scan App - Build Container') {
parallel {
stage('IQ-BOM') {
steps {
nexusPolicyEvaluation(iqApplication: 'sljavademo', iqStage: 'build', iqScanPatterns: [[scanPattern: '']])
}
}
stage('Shiftleft Analyze') {
steps {
sh '/usr/local/bin/sl analyze --app HelloShiftLeft --java target/hello-shiftleft-*.jar'
}
}
stage('Build Container') {
steps {
echo '...need to learn the build process first'
}
}
}
}
stage('Test Container') {
post {
success {
echo '...the Test Scan Passed!'
}
failure {
echo '...the Test FAILED'
error '...the Container Test FAILED'
}
}
steps {
echo '...run container and test it'
}
}
stage('Scan Container') {
post {
success {
echo '...the IQ Scan PASSED'
postGitHub(commitId, 'success', 'analysis', 'Nexus Lifecycle Container Analysis succeeded', "${policyEvaluationResult.applicationCompositionReportUrl}")
}
failure {
echo '...the IQ Scan FAILED'
postGitHub(commitId, 'failure', 'analysis', 'Nexus Lifecycle Containe Analysis failed', "${policyEvaluationResult.applicationCompositionReportUrl}")
error '...the IQ Scan FAILED'
}
}
steps {
echo '...TODO scan container'
}
}
stage('Publish Container') {
when {
branch 'master'
}
steps {
echo '...figure out container'
}
}
}
tools {
jdk 'jdk8'
maven 'M3'
}
}