Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

pre-receive and post-receive hook not working

vbhushan@kovair.com September 6, 2017

Tried creating a pre and post receive hook in bitBucket 5.2.2 instance but its not working on doing one commit to that repo.

I am just trying to create one txt file in that hook...

echo text in this file > bla.txt
echo test.

I am following this link help url

here, they said that if hook does not works then set isExecutable in application.xml file to true. but in my Bitbucket installation dir, there is no such file at BITBUCKET_HOME/logs/support 

1 answer

0 votes
Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2017

Hi!

Did you make the file executable (using chmod)?

Just to clarify, the application.xml file will only exist if you have generated a support zip, and it's a read-only file, so you don't need to make changes in it.

Cheers,

Christian

Premier Support Engineer

Atlassian

vbhushan@kovair.com September 6, 2017

Please tell how to make that file executable ?

I am naming that file as '21_bitbucket_callback'. The type of this file is 'File'.

and I am putting it into :

Atlassian\ApplicationData\Bitbucket\shared\data\repositories\52\hooks\post-receive.d

Also my BitBucket server is installed into Windows system.

 

Please help.

 

Thanks.

Mark A_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 7, 2017

Hey,

If you are an administrator, you can modify and or check the file permissions to ensure that the user running Bitbucket has the necessary permissions such as Read & Execute.

Go to the file and right-click. Select Properties and then select the Security tab. Selecting each user should display the permissions that user has in the lower window. 

If you are unfamiliar with verifying permissions in Windows, I recommend having your network administrator or server system administrator to assist you with verification.

-Mark W.

vbhushan@kovair.com September 7, 2017

Hi Mark,

Thanks for the reply. I tried with chmod command

(chomod -R a+x *) using Git bash to make those files executable ... and now its working.

Mark A_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 2017

That is great to hear! I'm glad it's working for you now.

If Christian's suggestion worked for you, feel free to select his reply as the solution by clicking the checkmark above.

Have a great day!

-Mark

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events