Welcome to mirror list, hosted at ThFree Co, Russian Federation.

file_hooks.rake « tasks « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5eb49808efffb47cba399b8c983fc8ef3fb1dada (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

namespace :file_hooks do
  desc 'Validate existing file hooks'
  task validate: :environment do
    puts 'Validating file hooks from /file_hooks directories'

    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