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

This widget could not be displayed.

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
Community showcase
Posted Thursday in United States

Local Atlassian Research Workshop opportunity on Sep. 28th

We're looking for participants for another workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sh...

37 views 0 0
View post

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