Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable git server hooks in 8.4.1

lin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2022

a clean fresh new bitbucket server

user:admin

home:/home/admin/atlassian/home

 

project and repository create

repository id:3

 

add a git hook script in directory:

/home/admin/atlassian/home/shared/data/repositories/3

admin@local$ tree hooks/
hooks/
├── post-receive
├── post-receive.d
│   └── 20_bitbucket_callback
├── pre-receive
└── pre-receive.d
├── 20_bitbucket_callback
└── 21_test

the [21_test] is the new script:

```

#!/usr/bin/env bash

echo "test"

exit 1

```

and the permission is fixed and checked:

admin@local$ ll
total 8
-rwxrwxr-x. 1 admin admin 416 Oct 3 19:21 20_bitbucket_callback
-rwxrwxr-x. 1 admin admin 41 Oct 3 19:23 21_test

 

but the output application.xml from support zip file is:

<repository>
<id>3</id>
<slug>test</slug>
<name>test</name>
<type>git</type>
<approximate-size>Unknown</approximate-size>
<state>AVAILABLE</state>
<status-message>Available</status-message>
<marked-public>false</marked-public>
<is-public>false</is-public>
<is-fork>false</is-fork>
<is-remote>false</is-remote>
<partition>-1</partition>
<available>true</available>
<branch-model>
<inherited>true</inherited>
<development-refId>refs/heads/master</development-refId>
</branch-model>
<jira-commit-checker/>
<repository-hooks/>
<pull-requests>
<open-pull-requests>0</open-pull-requests>
<merged-pull-requests>0</merged-pull-requests>
<declined-pull-requests>0</declined-pull-requests>
</pull-requests>
<git-lfs>
<enabled>false</enabled>
</git-lfs>
<configured-hook-scripts/>
</repository>

no git hook scripts detected and the hooks not work of course

 

i checked some docs like:

https://confluence.atlassian.com/bitbucketserverkb/git-hook-scripts-are-not-executing-779171211.html

https://confluence.atlassian.com/bitbucketserverkb/how-to-create-a-simple-hook-in-bitbucket-server-779171711.html

 

but nothing worked ever

how could i get the hooks work?

1 answer

0 votes
lin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 7, 2022

anybody could help me somehow?

QQ图片20221008093402.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events