In the past we have simply defined our custom hooks in <git_install_dir>/share/git-core/templates/hooks in order to have them included in all new repositories created by Stash.
In evaluating Stash 2.0.1, it appears that we need a way to automatically add our post-receive hook to <STASH_HOME>/data/repositories/<REPO_ID>/hooks/post-receive.d. I would really appreciate any suggestions on how to manage this. Thanks.
Hi Charles,
I have customized my post-receive hook to get email after every push. I have used atlassian SDK. So I have few java files and a soy template. How do I push them to my stash? Where exactly I have to copy it?
Please note that I want to do this only for one repository.
Thanks,
iihitp
Fantastic, Charles. Thanks very much for your support!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jefferson,
After creating a new repository Stash should be moving your pre/post receive hooks to pre/post-receive.d/10_custom. It is also possible to create post-receive.d/10_your_script in the templates directory directly (only in Stash 2.0.1 though).
Longer term we're planning to manage hooks _in_ Stash as plugins rather than as shell scripts on the filesystem. This is how we implemented branch permissions, and we hope to enhance both the documentation and the APIs in an uncoming release. If you're interested watch/vote on the following issue:
https://jira.atlassian.com/browse/STASH-2521
I hope this helps.
Charles
PS. If you're just trying to do a task asynchronously after every push I have created a simple Stash plugin that demonstrates a Jenkins build hook, as well as mentioning relevant parts of our in-app hooks API as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.