Skip to content

Commit

Permalink
Updates a local existing clone, after an eventual clean, in case the …
Browse files Browse the repository at this point in the history
…plugin repository was already cloned
  • Loading branch information
andsel committed Jun 1, 2023
1 parent 1324e65 commit e23677b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ci/test_supported_plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ def initialize(plugins_folder, plugin_name)
@plugin_base_folder = "#{plugins_folder}/#{plugin_name}"
end

def git_clone
def git_retrieve
if File.directory?(plugin_name)
puts "#{plugin_name} already cloned locally"
puts "#{plugin_name} already cloned locally, proceed with updating..."
Dir.chdir(plugin_name) do
system("git restore -- .")
puts "Cleaning following files"
system("git clean -n ")
puts "Proceed with cleaning"
system("git clean -Xf")
end
puts "#{plugin_name} updated"
return
end

Expand Down Expand Up @@ -204,7 +212,7 @@ def restore_logstash_from_snapshot

Dir.chdir(plugins_folder) do
plugin = Plugin.new(plugins_folder, plugin_name)
plugin.git_clone
plugin.git_retrieve

status = Dir.chdir(plugin_name) do
unless plugin.execute_rspec
Expand Down

0 comments on commit e23677b

Please sign in to comment.