Hook not being invoked!

I tried the "External Hooks" addon my Stash installation but doesn't matter what I do the hook(pre-receive) is not detected and the stash server rejects all pushes.

My hook simply has...

#!/bin/sh
echo "Hello World"

...and is present in the hooks directory inside my repository. In the executable field, I tried the following values "hooks/pre-receive.sh", "/hooks/pre-receive" and even the obsolute path in my PC but It is never triggered and the pushes are always rejected.

Am I missing something?

Do specify if you need more information.

1 answer

Hi!

You forgot to add execution rights. That will help:

chmod +x /path/to/hook

Hi! Where should I add this permission? Should I do that in the script body?

Hello! At first, your executable (file with script) must be placed on stash-server. And as it names executable, you should give it proper rights. Then you provide hook-plugin path to that script.

I don't want to sound naive But this chmod +x /path/to/hook command is to be executed in Stash, right?

Also, the path that was mentioned. Is it an absolute path in the server or relative path in the server

>this chmod +x /path/to/hook command is to be executed in Stash, right? Execute this command on your stash-server. >Is it an absolute path in the server or relative path in the server For me worked absolute path.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Friday in Off-topic

Friday Fun: Riddle me this

Happy Friday, Funmakers! We had a Community Team offsite in Austin this week, and my mind feels primed for thinkin' from all the brainstorming we did!  So, this week's Friday Fun thread w...

137 views 17 3
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you