mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
including dependencies, and reuse them in an offline installation by providing an package for it. It adds two important commands to the plugin manager, the pack and upack, to handle package creation and installation and adds the --local flag to install and update to pull plugins from the installed local packages. Former commits: add a task to create a bundle, under vendor/cache of the installed gems + their dependencies, this can be used later on to be installed offline add an option to pass the --local flag to the bin/plugin update task, so it fetch plugins from a local cache, by default under vendor/cache rename package:build to package:build-cache as is more meaningfull add a --local flag to bin/plugin install to users can install plugins from the local cache, under the default directory of vendor/cache add a plugin manager command to build the local cache of installed plugins using bundler package alike command It adds code for compressing and extracting in zip and tar formats to the utils module of logstash. The zip module is only jruby dependant as it uses functions provided by java. There is also code add in the plugin manager package command to handle compression of plugins dumping. Cleanup the custom java code to compress and extract zip files as it has been known that using rubyzip is good and it has a more ruby like features so the code is more clean and portable. set of smallish improvement requested during review added several options to handle situation when the package of plugins we want to generate is already there clean up old code applyed feedback from review, mostly changed in documentating behaviour plus better wording for messages relocate the Environment.windows? check to the bootstrap side as it's used also in the plugin manager add an unpack bin/plugin command so users can install packages of plugins throw the plugin manager document override behaviour in the compress helpers (for zip and tar) plus add a fix for the tar extract when reading entries made the unpack filename parameter a required one add a force option to the bin/plugin unpack command add a notice to that if using a local cache the --local flag should be passed with Code cleanup and refactor introduced during review add two wording suggestions comming from review ammend more wording skip the major version validation as in situation where there is no internet connection like when using the local vendor/cache to do the update move compress to the bootstrap environment as being used in the plugin manager means not being loaded with logstash-core Bring pack cached gems in the vendor directory so they can be used for bundler when packaging dependencies Revert "Bring pack cached gems in the vendor directory so they can be used for bundler when packaging dependencies" This reverts commit a9d7f46649932b06efaafebdd0eed2b4c63c2235. patch the Bundler::Source::Rubygems to fetch only gems from a remote source small changes in several parts of the plugin manager and the creation of a common pack command with shared code change compress to read in chuncks fix wrong var name in the bootstrap compress utils module fix namespacing conflicts add basic test for the compress utility module ammend more namespace issues add a comment to the rubygems mockey patch to rebuild the gem cache apply cosmetic changes make the compress module raise CompressError remove vendor_path and pattern_path form environment as they where mix up during rebase change the bin/pack force option to be force-delete-cache rename force_delete_cache to overwrite change force for overwrite in tha pack command remove the override option for bin/plugin unpack revert Gemfile and Genfile.lock wrong committed
13 lines
294 B
Ruby
13 lines
294 B
Ruby
# encoding: utf-8
|
|
require "bootstrap/util/compress"
|
|
require "fileutils"
|
|
|
|
class LogStash::PluginManager::PackCommand < LogStash::PluginManager::Command
|
|
def archive_manager
|
|
zip? ? LogStash::Util::Zip : LogStash::Util::Tar
|
|
end
|
|
|
|
def file_extension
|
|
zip? ? ".zip" : ".tar.gz"
|
|
end
|
|
end
|