Add creation of zipfile for the artifacts

Fixes #2221
This commit is contained in:
Richard Pijnenburg 2014-12-11 16:56:42 +00:00 committed by Jordan Sissel
parent 14832da1b7
commit 0f185a470e
2 changed files with 18 additions and 0 deletions

View file

@ -81,6 +81,19 @@ namespace "artifact" do
puts "Complete: #{tarpath}"
end
task "zip" => ["bootstrap", "plugin:install-defaults"] do
Rake::Task["dependency:rubyzip"].invoke
require 'zip'
zippath = "build/logstash-#{LOGSTASH_VERSION}.zip"
Zip::File.open(zippath, Zip::File::CREATE) do |zipfile|
files.each do |path|
path_in_zip = "logstash-#{LOGSTASH_VERSION}/#{path}"
zipfile.add(path_in_zip, path)
end
end
puts "Complete: #{zippath}"
end
def package(platform, version)
Rake::Task["dependency:fpm"].invoke
Rake::Task["dependency:stud"].invoke

View file

@ -21,4 +21,9 @@ namespace "dependency" do
task "fpm" do
Rake::Task["gem:require"].invoke("fpm", ">= 0", LogStash::Environment.logstash_gem_home)
end # task stud
task "rubyzip" do
Rake::Task["gem:require"].invoke("rubyzip", ">= 0", LogStash::Environment.logstash_gem_home)
end # task stud
end # namespace dependency