I created a simple Stash Post Hook plugin to send an email when fired. It is working perfectly on one repository, but on another, it is not ever being triggered. It is configured in both repos exactly the same.
I added logging, and can verify that is is never fired at all in the problematic repo, while it is in the working repo.
NOTE: I just tried it for a thrid repo we have, and it does not work. So apparently it is currently only fired for a single repo at the moment, even though it is configured on three. Also worth mentioning is that all three Repositories are under a single project in Stash.
I'm assuming it's enabled in all three of the repositories?
While this should never happen, it sounds like the post-receive scripts that we rely on in Stash have (somehow) been disabled. You're not using the subgit plugin by any chance and/or using your own manual Git hooks? I would take a look at the repositories in $STASH_HOME/data/repositories/$REPOID and see if the hooks/post-recieve and hooks/post-receive.d/20_stash_callback files are all executable and look exactly the same. Short of that I'm afraid I can't think of anything that would cause your hooks not to fire.
PS. Is it possible to see the source of your hook just so we can test it here?
@Charles Turns out the post-receive.d and pre-receive.d folders where not even in the 2 repos that were not working. The 2 non working repos, were also missing the hooks/post-receive and hooks/pre-receive scripts that call those in the folders. I copied all that over to the non-working repos, and now they work. Thanks for the help.
I have the same problem, I added a post-received hook in stash for a repo, and it don't fire.
my hooks/post-recieve and hooks/post-receive.d/20_stash_callback files are all executable but look different the same:
exec $STASH_HOOK_CALLBACK git-post-receive "$@" <&0 >&1 2>&2 for 20_stash_callback
exec $STASH_HOOK_COORDINATOR hooks/post-receive.d "$@" <&0 >&1 2>&2 for post-receive
can you help me please?
Those look correct. Are you saying Stash is not firing your post recieve plugin. Just out of curiosity do branch permissions work? That is, if you add a permission for a branch and try to push does Stash reject it? If it does then something is wrong with your plugin, and you might need to post more details. If the branch permission doesn't block the push then something is wrong with your configuration - please create a support ticket and attach a support zip.
We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs