2018-02-08 11:14:10 -05:00
|
|
|
namespace :plugins do
|
2018-02-19 12:20:53 -05:00
|
|
|
desc 'Validate existing plugins'
|
|
|
|
task validate: :environment do
|
|
|
|
puts 'Validating plugins from /plugins directory'
|
|
|
|
|
2018-02-19 12:55:54 -05:00
|
|
|
Gitlab::Plugin.files.each do |file|
|
2018-02-28 05:16:23 -05:00
|
|
|
success, message = Gitlab::Plugin.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
|