-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathload_gitolite_hooks.rb
77 lines (65 loc) · 2.05 KB
/
load_gitolite_hooks.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# frozen_string_literal: true
RedmineGitHosting::GitoliteHooks.register_hooks do
# Set source dir
source_dir Rails.root.join('plugins/redmine_git_hosting/contrib/hooks').to_s
# Declare GitoliteHooks to install
# Install executable
gitolite_hook do
name 'redmine_gitolite.rb'
source 'post-receive/redmine_gitolite.rb'
destination 'post-receive'
executable true
end
gitolite_hook do
name 'mail_notifications.py'
source 'post-receive/mail_notifications.py'
destination 'post-receive.d/mail_notifications'
executable true
end
# Install libs
gitolite_hook do
name 'git_hosting_config.rb'
source 'post-receive/lib/git_hosting_config.rb'
destination 'lib/git_hosting/config.rb'
executable false
end
gitolite_hook do
name 'git_hosting_custom_hook.rb'
source 'post-receive/lib/git_hosting_custom_hook.rb'
destination 'lib/git_hosting/custom_hook.rb'
executable false
end
gitolite_hook do
name 'git_hosting_http_helper.rb'
source 'post-receive/lib/git_hosting_http_helper.rb'
destination 'lib/git_hosting/http_helper.rb'
executable false
end
gitolite_hook do
name 'git_hosting_hook_logger.rb'
source 'post-receive/lib/git_hosting_hook_logger.rb'
destination 'lib/git_hosting/hook_logger.rb'
executable false
end
gitolite_hook do
name 'git_hosting_post_receive.rb'
source 'post-receive/lib/git_hosting_post_receive.rb'
destination 'lib/git_hosting/post_receive.rb'
executable false
end
gitolite_hook do
name 'git_multimail.py'
source 'post-receive/lib/git_multimail.py'
destination 'post-receive.d/git_multimail.py'
executable false
end
end
# Gitolite hooks can be found in Redmine root dir or in plugin root dir
[
Rails.root.join('redmine_git_hosting_hooks.rb').to_s,
Rails.root.join('plugins/redmine_git_hosting/custom_hooks.rb').to_s
].each do |file|
require_dependency file if File.exist? file
end
module LoadGitoliteHooks
end