I believe this use-case applies to custom hooks too, but my use-case is 
modifying gitlab-shell hooks, so not exactly supported.


I want hook for all repos, so I'm calling my own class in post-receive, 
this works great.

However post-receive is not called for 'accept merge request' events, and I 
have one repo where this is only way it'll ever get commits. So I migrated 
my script to 'update' hook. It continues work great for 'push' events, but 
fails in 'merge' events. Reason it fails is, because my ruby file is 
requiring a gem, and this gem invariably fails with 'loaderror'.


I postulate this is because on 'push' event, ssh forks the ruby instance, 
so it'll see all normally installed gems. But on 'merge' event we're 
running inside gitlab ruby instance, which won't see it.

I tried to workaround this, by calling my ruby script via system(), but 
even in that case, it'll fail for LoadError on 'merge' events.



Is it possible to use your own gems in custom hooks? I believe this answer, 
once satisfied also applies to my unsupported use-case. 

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/f938feb2-1f0f-4f46-8bb8-e47f0dec2118%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to