mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
parent
622b8bb199
commit
53bd15e1f4
1 changed files with 5 additions and 3 deletions
|
@ -6,13 +6,16 @@ require "file-dependencies/gem"
|
||||||
|
|
||||||
class LogStash::PluginManager::Update < LogStash::PluginManager::Command
|
class LogStash::PluginManager::Update < LogStash::PluginManager::Command
|
||||||
REJECTED_OPTIONS = [:path, :git, :github]
|
REJECTED_OPTIONS = [:path, :git, :github]
|
||||||
|
# These are local gems used by LS and needs to be filtered out of other plugin gems
|
||||||
|
NON_PLUGIN_LOCAL_GEMS = ["logstash-core", "logstash-core-event-java", "logstash-core-plugin-api"]
|
||||||
|
|
||||||
parameter "[PLUGIN] ...", "Plugin name(s) to upgrade to latest version", :attribute_name => :plugins_arg
|
parameter "[PLUGIN] ...", "Plugin name(s) to upgrade to latest version", :attribute_name => :plugins_arg
|
||||||
option "--[no-]verify", :flag, "verify plugin validity before installation", :default => true
|
option "--[no-]verify", :flag, "verify plugin validity before installation", :default => true
|
||||||
option "--local", :flag, "force local-only plugin update. see bin/logstash-plugin package|unpack", :default => false
|
option "--local", :flag, "force local-only plugin update. see bin/logstash-plugin package|unpack", :default => false
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
local_gems = gemfile.locally_installed_gems
|
# remove "system" local gems used by LS
|
||||||
|
local_gems = gemfile.locally_installed_gems.map(&:name) - NON_PLUGIN_LOCAL_GEMS
|
||||||
|
|
||||||
if local_gems.size > 0
|
if local_gems.size > 0
|
||||||
if update_all?
|
if update_all?
|
||||||
|
@ -21,7 +24,7 @@ class LogStash::PluginManager::Update < LogStash::PluginManager::Command
|
||||||
plugins_with_path = plugins_arg & local_gems.map(&:name)
|
plugins_with_path = plugins_arg & local_gems.map(&:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
warn_local_gems(plugins_with_path)
|
warn_local_gems(plugins_with_path) if plugins_with_path.size > 0
|
||||||
end
|
end
|
||||||
update_gems!
|
update_gems!
|
||||||
end
|
end
|
||||||
|
@ -47,7 +50,6 @@ class LogStash::PluginManager::Update < LogStash::PluginManager::Command
|
||||||
filtered_plugins = plugins.map { |plugin| gemfile.find(plugin) }
|
filtered_plugins = plugins.map { |plugin| gemfile.find(plugin) }
|
||||||
.compact
|
.compact
|
||||||
.reject { |plugin| REJECTED_OPTIONS.any? { |key| plugin.options.has_key?(key) } }
|
.reject { |plugin| REJECTED_OPTIONS.any? { |key| plugin.options.has_key?(key) } }
|
||||||
.select { |plugin| local? }
|
|
||||||
.each { |plugin| gemfile.update(plugin.name) }
|
.each { |plugin| gemfile.update(plugin.name) }
|
||||||
|
|
||||||
# force a disk sync before running bundler
|
# force a disk sync before running bundler
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue