1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-11-24 08:32:32 +02:00

add snyk html report

This commit is contained in:
Christopher Fenner 2018-06-26 16:00:26 +02:00
parent 957ca11d7b
commit b44ebf99d1
No known key found for this signature in database
GPG Key ID: 749881F766EA636F

View File

@ -83,16 +83,19 @@ def call(Map parameters = [:]) {
cmd.push('&& snyk test')
if(config.toJson)
cmd.push("--json > ${config.snykResultFile}")
sh cmd.join(' ')
try{
sh cmd.join(' ')
}finally{
if(config.toHtml)
sh "snyk-to-html -i ${path}${config.snykResultFile} -o ${path}snyk.html"
}
}
}
}finally{
if(config.toJson)
archiveArtifacts "${path.replaceAll('\\./', '')}${config.snykResultFile}"
if(config.toHtml){
sh "cd '${path}' && snyk-to-html -i ${config.snykResultFile} -o snyk.html"
if(config.toHtml)
archiveArtifacts "${path.replaceAll('\\./', '')}snyk.html"
}
}
break
default: