summaryrefslogtreecommitdiff
path: root/lib/gitlab/plugin.rb
blob: 9604cac4b208357bb4f4c9ca4f8fd6c8b5c22d00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Gitlab
  module Plugin
    def self.files
      Dir.glob(Rails.root.join('plugins', '*_plugin.rb'))
    end

    def self.execute_all_async(data)
      files.each do |file|
        PluginWorker.perform_async(file, data)
      end
    end

    def self.execute(file, data)
      # TODO: Implement
      #
      # Reuse some code from gitlab-shell https://gitlab.com/gitlab-org/gitlab-shell/blob/master/lib/gitlab_custom_hook.rb#L40
      # Pass data as STDIN (or JSON encode?)
      #
      # 1. Return true if 0 exit code
      # 2. Return false if non-zero exit code
    end
  end
end