From 122c87dce296d39565d116d1732b1a68e4f6f549 Mon Sep 17 00:00:00 2001 From: Robert Auer Date: Wed, 27 Nov 2024 14:28:16 +0100 Subject: [PATCH] Remove newlines from ssh output; #136 --- src/com/cloudogu/ces/cesbuildlib/Trivy.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/cloudogu/ces/cesbuildlib/Trivy.groovy b/src/com/cloudogu/ces/cesbuildlib/Trivy.groovy index 7214fe6..fbbc899 100644 --- a/src/com/cloudogu/ces/cesbuildlib/Trivy.groovy +++ b/src/com/cloudogu/ces/cesbuildlib/Trivy.groovy @@ -92,8 +92,8 @@ class Trivy implements Serializable { String additionalFlags = "--db-repository public.ecr.aws/aquasecurity/trivy-db --java-db-repository public.ecr.aws/aquasecurity/trivy-java-db", String trivyReportFile = "trivy/trivyReport.json" ) { - String image = script.sh(script: "jq .Image ${doguDir}/dogu.json", returnStdout: true) - String version = script.sh(script: "jq .Version ${doguDir}/dogu.json", returnStdout: true) + String image = script.sh(script: "jq .Image ${doguDir}/dogu.json", returnStdout: true).trim() + String version = script.sh(script: "jq .Version ${doguDir}/dogu.json", returnStdout: true).trim() return scanImage(image+":"+version, severityLevel, strategy, additionalFlags, trivyReportFile) }