|
64 | 64 | end
|
65 | 65 | end
|
66 | 66 |
|
67 |
| - |
68 |
| -# You can declare here you own hooks to install globally in Gitolite. |
69 |
| -# You must set the source directory of the files with the *source_dir* method and |
70 |
| -# declare your hooks with *gitolite_hook* method. (see above) |
71 |
| -# |
72 |
| -# *RedmineGitHosting::GitoliteHooks.register_hooks* can be called multiple times |
73 |
| -# with a different *source_dir*. |
74 |
| -# |
75 |
| -# *name* : the hook name (to identify the hook) |
76 |
| -# *source* : the source path concatenated with *source_dir* |
77 |
| -# *destination* : the destination path on Gitolite side. |
78 |
| -# |
79 |
| -# The *destination* must be relative. |
80 |
| -# The final destination depends on your Gitolite version : |
81 |
| -# |
82 |
| -# Gitolite v3 : <gitolite_home_dir>/local/hooks/common/ |
83 |
| -# Gitolite v2 : <gitolite_home_dir>/.gitolite/hooks/common |
84 |
| -# |
85 |
| -# RedmineGitHosting::GitoliteHooks.register_hooks do |
86 |
| -# # Set source directory : /tmp/foo |
87 |
| -# source_dir File.join('/', 'tmp', 'foo') |
88 |
| -# |
89 |
| -# gitolite_hook do |
90 |
| -# # Hook name |
91 |
| -# name 'bar.rb' |
92 |
| -# |
93 |
| -# # Will be /tmp/foo/pre-receive/lib/bar.rb |
94 |
| -# source 'pre-receive/lib/bar.rb' |
95 |
| -# |
96 |
| -# # Will be <gitolite_home_dir>/local/hooks/common/lib_toto/test.rb (Gitolite v3) |
97 |
| -# # Will be <gitolite_home_dir>/.gitolite/hooks/common/lib_toto/test.rb (Gitolite v2) |
98 |
| -# destination 'lib_toto/test.rb' |
99 |
| -# |
100 |
| -# executable false |
101 |
| -# end |
102 |
| -# end |
| 67 | +# Gitolite hooks can be found in Redmine root dir or in plugin root dir |
| 68 | +[ |
| 69 | + Rails.root.join('redmine_git_hosting_hooks.rb').to_s, |
| 70 | + Rails.root.join('plugins', 'redmine_git_hosting', 'custom_hooks.rb').to_s |
| 71 | +].each do |file| |
| 72 | + require_dependency file if File.exist?(file) |
| 73 | +end |
0 commit comments