diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-02-28 13:16:23 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-02-28 13:16:23 +0300 |
commit | 2577ff7fd656f301c4b1909f0a1c358c8c30a614 (patch) | |
tree | a7c04e89e47df5610fdd189597c58d48f9075e76 /doc/administration/plugins.md | |
parent | 4eed9a12216296709306ce29faf607d8aed2a913 (diff) |
Refactor plugins feature and make some doc improvements
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'doc/administration/plugins.md')
-rw-r--r-- | doc/administration/plugins.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/administration/plugins.md b/doc/administration/plugins.md index 89ab0b9c8ea..ed1a3480ffc 100644 --- a/doc/administration/plugins.md +++ b/doc/administration/plugins.md @@ -11,7 +11,7 @@ A plugin will run on each event so it's up to you to filter events or projects w ## Setup -Plugins must be placed directly into `plugins` directory, subdirectories will be ignored. There is an `example` directory insider `plugins` where you can find some basic examples. +Plugins must be placed directly into `plugins` directory, subdirectories will be ignored. There is an `example` directory inside `plugins` where you can find some basic examples. Follow the steps below to set up a custom hook: @@ -20,11 +20,12 @@ Follow the steps below to set up a custom hook: `/home/git/gitlab/plugins/`. For Omnibus installs the path is usually `/opt/gitlab/embedded/service/gitlab-rails/plugins`. 1. Inside the `plugins` directory, create a file with a name of your choice, but without spaces or special characters. -1. Make the hook file executable and make sure it's owned by git. +1. Make the hook file executable and make sure it's owned by the git user. 1. Write the code to make the plugin function as expected. Plugin can be in any language. Ensure the 'shebang' at the top properly reflects the language type. For example, if the script is in Ruby the shebang will probably be `#!/usr/bin/env ruby`. +1. The data to the plugin will be provided as JSON on STDIN. It will be exactly same as one for [system hooks] That's it! Assuming the plugin code is properly implemented the hook will fire as appropriate. Plugins file list is updated for each event. There is no need to restart GitLab to apply a new plugin. |