mirror of
https://github.com/elastic/logstash.git
synced 2025-04-20 04:37:18 -04:00
Fix the license check CI task
This does a few small things: 1. Prefer invoking rake tasks via ./gradlew vs rake. This prevents Java from segfaulting on docker for unknown reasons 2. Remove use of COPYING.csv which has already been removed
This commit is contained in:
parent
82cd7105e4
commit
8f03e82249
5 changed files with 26 additions and 8 deletions
|
@ -35,8 +35,7 @@ RUN echo 'eval "$(rbenv init -)"' >> .bashrc && \
|
|||
# Create a cache for the dependencies based on the current master, any dependencies not cached will be downloaded at runtime
|
||||
RUN git clone https://github.com/elastic/logstash.git /tmp/logstash && \
|
||||
cd /tmp/logstash && \
|
||||
rake test:install-core && \
|
||||
./gradlew compileJava compileTestJava && \
|
||||
./gradlew bootstrap compileJava compileTestJava && \
|
||||
cd qa/integration && \
|
||||
/home/logstash/.rbenv/shims/bundle install && \
|
||||
mv /tmp/logstash/vendor /tmp/vendor && \
|
||||
|
|
13
build.gradle
13
build.gradle
|
@ -149,6 +149,19 @@ task downloadAndInstallJRuby(dependsOn: verifyFile, type: Copy) {
|
|||
into "${projectDir}/vendor/jruby"
|
||||
}
|
||||
|
||||
task installDefaultGems(dependsOn: downloadAndInstallJRuby) {
|
||||
inputs.files file("${projectDir}/Gemfile.template")
|
||||
inputs.files fileTree("${projectDir}/rakelib")
|
||||
inputs.files file("${projectDir}/versions.yml")
|
||||
outputs.file("${projectDir}/Gemfile")
|
||||
outputs.file("${projectDir}/Gemfile.lock")
|
||||
outputs.dir("${projectDir}/logstash-core/lib/jars")
|
||||
outputs.dir("${projectDir}/vendor/bundle/jruby/2.3.0")
|
||||
doLast {
|
||||
rubyGradleUtils.rake('plugin:install-default')
|
||||
}
|
||||
}
|
||||
|
||||
task installTestGems(dependsOn: downloadAndInstallJRuby) {
|
||||
inputs.files file("${projectDir}/Gemfile.template")
|
||||
inputs.files fileTree("${projectDir}/rakelib")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash -i
|
||||
export GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info"
|
||||
|
||||
rake plugin:install-default
|
||||
./gradlew installDefaultGems
|
||||
bin/dependencies-report --csv report.csv
|
||||
# We want this to show on the CI server
|
||||
cat report.csv
|
||||
|
|
|
@ -20,11 +20,17 @@ class LogStash::DependencyReport < Clamp::Command
|
|||
jars.each { |d| csv << d }
|
||||
end
|
||||
|
||||
# Copy in COPYING.csv which is a best-effort, hand-maintained file of dependency license information.
|
||||
File.open(output_path, "a+") do |file|
|
||||
extra = File.join(File.dirname(__FILE__), "..", "..", "..", "COPYING.csv")
|
||||
file.write(IO.read(extra))
|
||||
puts "Wrote temporary ruby deps CSV to #{ruby_output_path}"
|
||||
|
||||
# Use gradle to find the rest and add to the ruby CSV
|
||||
puts "Find gradle jar dependencies #{Dir.pwd}"
|
||||
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}"
|
||||
end
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf-8
|
||||
:# encoding utf-8
|
||||
require "spec_helper"
|
||||
require "logstash/plugin"
|
||||
require "logstash/outputs/base"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue