Skip to content

Commit 5941a0f

Browse files
robbaveymashhurs
andauthored
6.x Backport: Remove jar-dependencies dependency (#510)
* 6.x Backport: Remove jar-dependencies dependency Backport of #509 for 6.x branch * Remove jar-dependencies dependency * Fix package installer for ubi8-based testing * Filebeat artifact untar refactoring. --------- Co-authored-by: Mashhur <[email protected]>
1 parent 2a96c66 commit 5941a0f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.ci/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
if [ $(command -v apt) ]; then
44
sudo apt install -y openssl
55
else
6-
sudo yum install -y openssl
7-
fi
6+
sudo microdnf install -y openssl
7+
fi

lib/tasks/test.rake

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,19 @@ namespace :test do
4040
puts "Filebeat: downloading from #{FILEBEAT_URL} to #{download_destination}"
4141
download(FILEBEAT_URL, download_destination)
4242

43-
untar_all(download_destination, File.join(VENDOR_PATH, "filebeat")) { |e| e }
43+
untar_all(download_destination, VENDOR_PATH) { |e| e }
4444
end
4545
end
4646
end
4747
end
4848

49-
# Uncompress all the file from the archive this only work with
50-
# one level directory structure and filebeat packaging.
49+
require 'zlib'
50+
require 'minitar'
51+
5152
def untar_all(file, destination)
52-
untar(file) do |entry|
53-
out = entry.full_name.split("/").last
54-
File.join(destination, out)
53+
Zlib::GzipReader.open(file) do |reader|
54+
Minitar.unpack(reader, destination)
5555
end
56+
filebeat_full_name = Dir.glob(destination + "/filebeat-*").first
57+
File.rename(filebeat_full_name, destination + "/filebeat")
5658
end

logstash-input-beats.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
2626
s.add_runtime_dependency "concurrent-ruby", "~> 1.0"
2727
s.add_runtime_dependency "thread_safe", "~> 0.3.5"
2828
s.add_runtime_dependency "logstash-codec-multiline", ">= 2.0.5"
29-
s.add_runtime_dependency 'jar-dependencies', '~> 0.3', '>= 0.3.4'
3029
s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.3'
3130
s.add_runtime_dependency 'logstash-mixin-event_support', '~>1.0'
3231
s.add_runtime_dependency 'logstash-mixin-plugin_factory_support', '~>1.0'

0 commit comments

Comments
 (0)