-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile_diff
More file actions
51 lines (49 loc) · 2.22 KB
/
Jenkinsfile_diff
File metadata and controls
51 lines (49 loc) · 2.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pipeline {
agent any
stages {
stage('Build') {
steps {
withMaven( maven: 'mvn3' ) {
sh '''
# Build the war
mvn clean package
# Remove any and all source files from the war
zip -d target/struts2-showcase.war *.java
'''
}
}
}
stage('RLTest') {
steps {
sh '''
# Scan our build artifact
/bin/RLSecure/rl-secure scan target/struts2-showcase.war \
-s /bin/RLSecure -p Apache/struts2-showcaseDIFF@2.5.28_$BUILD_NUMBER --no-tracking
# Generate reports including Diff with previous build
PREV_BUILD_NUM=`expr $BUILD_NUMBER - 1`
/bin/RLSecure/rl-secure report -s /bin/RLSecure \
-p Apache/struts2-showcaseDIFF@2.5.28_$BUILD_NUMBER \
--format cyclonedx,spdx,rl-html,rl-json --diff-with 2.5.28_$PREV_BUILD_NUM \
--output-path RLreports/$BUILD_NUMBER --force
# Get status - this returns a non-zero exit code (and cause step to fail) if any issues are found that violate policy.
/bin/RLSecure/rl-secure status -s /bin/RLSecure \
-p Apache/struts2-showcaseDIFF@2.5.28_$BUILD_NUMBER \
--no-color --return-status
'''
}
}
}
post {
always {
sh '''
# Copy the reports to a static location or else the plugins won't work
mkdir -p RLreports/latest
PREV_BUILD_NUM=`expr $BUILD_NUMBER - 1`
cp RLreports/$BUILD_NUMBER/*.json RLreports/latest
cp -R RLreports/$BUILD_NUMBER/rl-html-diff-with-2.5.28_$PREV_BUILD_NUM/. RLreports/latest
'''
archiveArtifacts artifacts: 'RLreports/latest/*.json', onlyIfSuccessful: false
publishHTML([reportDir: 'RLreports/latest', reportFiles: 'sdlc.html', reportName: 'ReversingLabs Report', allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportTitles: '', useWrapperFileDirectly: true])
}
}
}