2018-02-19 17:20:53 +00:00
|
|
|
module Gitlab
|
|
|
|
module Plugin
|
2018-02-19 17:55:54 +00:00
|
|
|
def self.files
|
|
|
|
Dir.glob(Rails.root.join('plugins', '*_plugin.rb'))
|
|
|
|
end
|
2018-02-19 17:20:53 +00:00
|
|
|
|
2018-02-19 17:55:54 +00:00
|
|
|
def self.execute_all_async(data)
|
|
|
|
files.each do |file|
|
|
|
|
PluginWorker.perform_async(file, data)
|
2018-02-19 17:20:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-02-19 17:55:54 +00:00
|
|
|
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
|
2018-02-19 17:20:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|