简体   繁体   中英

How to enable gerrit hooks plugin?

Hi I am running gerrit server by docker image (gerritcodereview/gerrit:3.2.3). I accessed with "docker exec" and made "/var/gerrit/hooks" directory and executable files "commit-received, patchset-created, ref-update, submit" to use gerrit hooks plugin. But all hooks don't work even when it should be. Do I have to modify more to use gerrit hooks plugin?

And I have one more question. Is there any plugins to use pre-submit hook in gerrit?

There are two groups of these hooks: client-side and server-side .

Client side hooks are triggered by operations such as committing and merging, while server-side hooks run on network operations such as receiving pushed commits.

The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that's .git/hooks.

you can write them in Ruby or Python or whatever language you are familiar with. If you want to use the bundled hook scripts, you'll have to rename them; their file names all end with .sample.

To enable a hook script, put a file in the hooks subdirectory of your .git directory that is named appropriately (without any extension) and is executable .

Step 1 Config your hook path in Gerrit config

[hook]
     path = /xxx/hooks

Step 2 Make your script executable in the path folder

Here is /xxx/hooks/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM