fail license report job on missing licenses

Fixes #11554
This commit is contained in:
Joao Duarte 2020-01-30 10:45:23 +00:00 committed by João Duarte
parent 80cd89673d
commit f12eb2f28a
3 changed files with 8 additions and 2 deletions

View file

@ -3,5 +3,10 @@ export GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -D
./gradlew installDefaultGems
bin/dependencies-report --csv report.csv
result=$?
# We want this to show on the CI server
cat report.csv
exit $result

View file

@ -32,8 +32,9 @@ class LogStash::DependencyReport < Clamp::Command
command = ["./gradlew", "generateLicenseReport", "-PlicenseReportInputCSV=#{ruby_output_path}", "-PlicenseReportOutputCSV=#{output_path}"]
puts "Executing #{command}"
system(*command)
if $?.exitstatus != 0
raise "Could not run gradle java deps! Exit status #{$?.exitstatus}"
raise "generateLicenseReport failed with exit status #{$?.exitstatus}"
end
nil

View file

@ -46,7 +46,7 @@ public class Main {
);
// If there were unknown results in the report, exit with a non-zero status
//System.exit(reportResult ? 0 : 1);
System.exit(reportResult ? 0 : 1);
}
static InputStream getResourceAsStream(String resourcePath) {