Skip to content

Commit a28ad47

Browse files
committed
Save all trivy report files; #136
1 parent a65c6e2 commit a28ad47

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/com/cloudogu/ces/cesbuildlib/Trivy.groovy

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Trivy implements Serializable {
55
private script
66
private Docker docker
77
private String trivyVersion
8-
private String trivyDirectory = ".trivy"
8+
private String trivyDirectory = "trivy"
99
private String trivyReportFilenameWithoutExtension = trivyDirectory+"/trivyReport"
1010

1111
Trivy(script, Docker docker = new Docker(script), String trivyVersion = "0.57.1") {
@@ -30,7 +30,7 @@ class Trivy implements Serializable {
3030
*/
3131
boolean scanImage(
3232
String imageName,
33-
String trivyReportFilename = "${this.script.env.WORKSPACE}/.trivy/trivyReport.json",
33+
String trivyReportFilename = "${this.script.env.WORKSPACE}/trivy/trivyReport.json",
3434
String additionalFlags = "",
3535
String severityLevel = TrivySeverityLevel.CRITICAL,
3636
String strategy = TrivyScanStrategy.FAIL
@@ -64,7 +64,7 @@ class Trivy implements Serializable {
6464
*
6565
* @param format The format of the output file (@see TrivyScanFormat)
6666
*/
67-
void saveFormattedTrivyReport(String format = TrivyScanFormat.HTML, String trivyReportFilename = "${script.env.WORKSPACE}/.trivy/trivyReport.json") {
67+
void saveFormattedTrivyReport(String format = TrivyScanFormat.HTML, String trivyReportFilename = "${script.env.WORKSPACE}/trivy/trivyReport.json") {
6868
String formatExtension
6969
switch (format) {
7070
case TrivyScanFormat.HTML:
@@ -84,6 +84,6 @@ class Trivy implements Serializable {
8484
script.sh(script: "trivy convert --format ${format} --output ${trivyReportFilenameWithoutExtension}.${formatExtension} ${trivyReportFilename}")
8585
}
8686

87-
script.archiveArtifacts artifacts: "${trivyReportFilenameWithoutExtension}.${format}", allowEmptyArchive: true
87+
script.archiveArtifacts artifacts: "${trivyReportFilenameWithoutExtension}.*", allowEmptyArchive: true
8888
}
8989
}

0 commit comments

Comments
 (0)