Skip to content
Snippets Groups Projects

Make custom hook dir configurable

Merged username-removed-443319 requested to merge make-custom-hook-dir-configurable into master
All threads resolved!
6 files
+ 76
24
Compare changes
  • Side-by-side
  • Inline
Files
6
  • fbc213ea
    Make custom hooks dir configurable · fbc213ea
    Sean McGivern authored
    Add a new configuration option, custom_hooks_dir. When this is set, we
    will look for global custom hooks in:
        <custom_hooks_dir>/{pre-receive,update,post-receive}.d/*
    
    When this is not set, default to <REPO_PATH>/hooks.
+ 7
0
@@ -19,6 +19,13 @@ class GitlabConfig
@config['secret_file'] ||= File.join(ROOT_PATH, '.gitlab_shell_secret')
end
# Pass a default value because this is called from a repo's context; in which
# case, the repo's hooks directory should be the default.
#
def custom_hooks_dir(default: nil)
@config['custom_hooks_dir'] || default
end
def gitlab_url
(@config['gitlab_url'] ||= "http://localhost:8080").sub(%r{/*$}, '')
end
Loading