terrimonster / gitworkshop

GIT workshop for PuppetConf2014
10 stars 1 forks source link

Overwriting gitlab pre-recieve hook is bad #4

Open spuder opened 9 years ago

spuder commented 9 years ago

In the example, the user is instructed to do a cp -R of the hooks directory. Gitlab already uses the pre-receive, post-recieve and update webhooks, so overwriting them will cause problems. https://github.com/gitlabhq/gitlab-shell/tree/master/hooks

The alternatives are:

  1. Rewrite the puppet-lint and puppet validate commands in ruby and append them to the existing pre-recieve hook
  2. Put the puppet pre-receive bash script in a different file, then have the existing pre-receve hook call that script.

Maybe this should be clarified in the readme that you shouldn't overwrite these webhooks.

spuder commented 9 years ago

Note that in gitlab 7.5, the recommended implementation will be to create a new directory called custom_hooks and put the hooks in there.

http://doc.gitlab.com/ce/hooks/custom_hooks.html