[go: up one dir, main page]

Skip to content

gitlab-shell doesn't handle custom hooks path

Hi, I've found that gitlab-shell doesn't support custom hooks path, defined by gitlab_rails['gitlab_shell_hooks_path'] variable. In particular, script create_hooks by default creates links to hooks under /opt/gitlab/embedded/service/gitlab-shell/hooks directory. That is because variable GLOBAL_HOOKS_DIRECTORY points to ROOT_PATH/hooks in the file gitlab_projects.rb. This is not correct approach.

We have migrated from source installation type to omnibus package. Now gitlab is installed under /opt/gitlab, but we have repositories located under /home/git/repositories and custom update hook under /home/git/gitlab-shell/hooks. We used gitlab_rails['gitlab_shell_hooks_path'] variable to define path, and it works, except of new projects - their hooks are pointing to /opt/gitlab.... So now we have a problem:

  1. If we copy our custom hooks to /opt/gitlab/embedded/service/gitlab-shell/hooks, it works, but we will lose our custom hooks on upgrade.
  2. If we change GLOBAL_HOOKS_DIRECTORY directly in the lib/gitlab_projects.rb file, it'll work, but we still will lose our changes on upgrade.
    Thus, I've made a small change to define variable "hooks_path" in config.yml and use it in gitlab_projects.rb. My changes are commited in a fork of the project alivespirit/gitlab-shell@705b5967 . I really hope to see these changes released as soon as possible.

Thank you,
Roman