summaryrefslogtreecommitdiff
path: root/lib/tasks/file_hooks.rake
blob: 20a726de65b0a9b8d4223af6ba0f79b3bffdb717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
namespace :file_hooks do
  desc 'Validate existing plugins'
  task validate: :environment do
    puts 'Validating file hooks from /plugins directory'

    Gitlab::FileHook.files.each do |file|
      success, message = Gitlab::FileHook.execute(file, Gitlab::DataBuilder::Push::SAMPLE_DATA)

      if success
        puts "* #{file} succeed (zero exit code)."
      else
        puts "* #{file} failure (non-zero exit code). #{message}"
      end
    end
  end
end