Removing the gembag and the download of the vendored files since the logic was moved into their specific gems.

Fixes #2272
This commit is contained in:
Pier-Hugues Pellerin 2014-12-19 10:34:23 -05:00 committed by Jordan Sissel
parent 58d1e8df57
commit dd5685dc2e
2 changed files with 0 additions and 175 deletions

View file

@ -1,74 +0,0 @@
#!/usr/bin/env ruby
require "logstash/environment"
# set gem paths here to help find the required gems below
ENV["GEM_PATH"] = LogStash::Environment.gem_home
ENV["GEM_HOME"] = LogStash::Environment.gem_home
require "rubygems/specification"
require "rubygems/commands/install_command"
require "logstash/JRUBY-PR1448" if RUBY_PLATFORM == "java" && Gem.win_platform?
def install_gem(name, requirement, target)
puts "Fetching and installing gem: #{name} (#{requirement})"
installer = Gem::Commands::InstallCommand.new
installer.options[:generate_rdoc] = false
installer.options[:generate_ri] = false
installer.options[:version] = requirement
installer.options[:args] = [name]
installer.options[:install_dir] = target
# ruby 2.0.0 / rubygems 2.x; disable documentation generation
installer.options[:document] = []
begin
installer.execute
rescue Gem::SystemExitException => e
if e.exit_code != 0
puts "Installation of #{name} failed"
raise
end
end
end # def install_gem
# Ensure bundler is available.
begin
gem("bundler", ">=1.7.3")
rescue Gem::LoadError => e
install_gem("bundler", ">= 1.7.3", LogStash::Environment.gem_home)
end
require "bundler/cli"
# Monkeypatch bundler to write a .lock file specific to the version of ruby.
# This keeps MRI/JRuby/RBX from conflicting over the Gemfile.lock updates
module Bundler
module SharedHelpers
def default_lockfile
ruby = "#{LogStash::Environment.ruby_engine}-#{LogStash::Environment.gem_ruby_version}"
Pathname.new("#{default_gemfile}.#{ruby}.lock")
end
end
end
if LogStash::Environment.ruby_engine == "rbx"
begin
gem("rubysl")
rescue Gem::LoadError => e
install_gem("rubysl", ">= 0", LogStash::Environment.gem_home)
end
end
# Try installing a few times in case we hit the "bad_record_mac" ssl error during installation.
10.times do
begin
Bundler::CLI.start(["install", "--gemfile=#{LogStash::Environment::GEMFILE_PATH}", "--path", LogStash::Environment::BUNDLE_DIR, "--standalone", "--clean", "--without", "development"])
break
rescue Gem::RemoteFetcher::FetchError => e
puts e.message
puts e.backtrace.inspect
sleep 5 #slow down a bit before retry
end
end

View file

@ -1,22 +1,12 @@
DOWNLOADS = {
"elasticsearch" => { "version" => "1.3.0", "sha1" => "f9e02e2cdcb55e7e8c5c60e955f793f68b7dec75" },
"collectd" => { "version" => "5.4.0", "sha1" => "a90fe6cc53b76b7bdd56dc57950d90787cb9c96e" },
#"jruby" => { "version" => "1.7.13", "sha1" => "0dfca68810a5eed7f12ae2007dc2cc47554b4cc6" }, # jruby-complete
"jruby" => { "version" => "1.7.16", "sha1" => "4c912b648f6687622ba590ca2a28746d1cd5d550" },
"kibana" => { "version" => "3.1.2", "sha1" => "a59ea4abb018a7ed22b3bc1c3bcc6944b7009dc4" },
"geoip" => {
"GeoLiteCity" => { "version" => "2013-01-18", "sha1" => "15aab9a90ff90c4784b2c48331014d242b86bf82", },
"GeoIPASNum" => { "version" => "2014-02-12", "sha1" => "6f33ca0b31e5f233e36d1f66fbeae36909b58f91", }
},
"kafka" => { "version" => "0.8.1.1", "sha1" => "d73cc87fcb01c62fdad8171b7bb9468ac1156e75", "scala_version" => "2.9.2" },
}
def vendor(*args)
return File.join("vendor", *args)
end
# Untar any files from the given tarball file name.
#
# A tar entry is passed to the block. The block should should return
@ -92,34 +82,6 @@ namespace "vendor" do
task "all" => "jruby"
task "test" => "jruby"
task "geoip" do |task, args|
vendor_name = "geoip"
parent = vendor(vendor_name).gsub(/\/$/, "")
directory parent => "vendor" do
mkdir parent
end.invoke unless Rake::Task.task_defined?(parent)
vendor(vendor_name).tap { |v| mkdir_p v unless File.directory?(v) }
files = DOWNLOADS[vendor_name]
files.each do |name, info|
version = info["version"]
url = "http://logstash.objects.dreamhost.com/maxmind/#{name}-#{version}.dat.gz"
download = file_fetch(url, info["sha1"])
outpath = vendor(vendor_name, "#{name}.dat")
tgz = Zlib::GzipReader.new(File.open(download))
begin
File.open(outpath, "w") do |out|
IO::copy_stream(tgz, out)
end
rescue
File.unlink(outpath) if File.file?(outpath)
raise
end
tgz.close
end
end
#task "all" => "geoip"
task "kibana" do |task, args|
name = task.name.split(":")[1]
info = DOWNLOADS[name]
@ -140,69 +102,6 @@ namespace "vendor" do
task "all" => "kibana"
task "test" => "kibana"
task "kafka" do |task, args|
name = task.name.split(":")[1]
info = DOWNLOADS[name]
version = info["version"]
scala_version = info["scala_version"]
url = "https://archive.apache.org/dist/kafka/#{version}/kafka_#{scala_version}-#{version}.tgz"
download = file_fetch(url, info["sha1"])
parent = vendor(name).gsub(/\/$/, "")
directory parent => "vendor" do
mkdir parent
end.invoke unless Rake::Task.task_defined?(parent)
untar(download) do |entry|
next unless entry.full_name =~ /\.jar$/
vendor(name, File.basename(entry.full_name))
end
end # task kafka
#task "all" => "kafka"
task "elasticsearch" do |task, args|
name = task.name.split(":")[1]
info = DOWNLOADS[name]
version = info["version"]
url = "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-#{version}.tar.gz"
download = file_fetch(url, info["sha1"])
parent = vendor(name).gsub(/\/$/, "")
directory parent => "vendor" do
mkdir parent
end.invoke unless Rake::Task.task_defined?(parent)
untar(download) do |entry|
next unless entry.full_name =~ /\.jar$/
vendor(name, File.basename(entry.full_name))
end # untar
end # task elasticsearch
#task "all" => "elasticsearch"
task "collectd" do |task, args|
name = task.name.split(":")[1]
info = DOWNLOADS[name]
version = info["version"]
sha1 = info["sha1"]
url = "https://collectd.org/files/collectd-#{version}.tar.gz"
download = file_fetch(url, sha1)
parent = vendor(name).gsub(/\/$/, "")
directory parent => "vendor" do
mkdir parent
end unless Rake::Task.task_defined?(parent)
file vendor(name, "types.db") => [download, parent] do |task, args|
next if File.exists?(task.name)
untar(download) do |entry|
next unless entry.full_name == "collectd-#{version}/src/types.db"
vendor(name, File.basename(entry.full_name))
end # untar
end.invoke
end
#task "all" => "collectd"
namespace "force" do
task "gems" => ["vendor:gems"]
end