2020-01-16 10:08:41 -05:00
|
|
|
namespace :file_hooks do
|
2018-02-19 12:20:53 -05:00
|
|
|
desc 'Validate existing plugins'
|
|
|
|
task validate: :environment do
|
2020-01-16 10:08:41 -05:00
|
|
|
puts 'Validating file hooks from /plugins directory'
|
2018-02-19 12:20:53 -05:00
|
|
|
|
2020-01-16 10:08:41 -05:00
|
|
|
Gitlab::FileHook.files.each do |file|
|
|
|
|
success, message = Gitlab::FileHook.execute(file, Gitlab::DataBuilder::Push::SAMPLE_DATA)
|
2018-02-19 12:55:54 -05:00
|
|
|
|
2018-02-28 05:16:23 -05:00
|
|
|
if success
|
|
|
|
puts "* #{file} succeed (zero exit code)."
|
2018-02-19 12:20:53 -05:00
|
|
|
else
|
2018-02-28 05:16:23 -05:00
|
|
|
puts "* #{file} failure (non-zero exit code). #{message}"
|
2018-02-19 12:20:53 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2018-02-08 11:14:10 -05:00
|
|
|
end
|