Forums

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

Git server side hooks for triggering Jenkins job on pull request merge

Poreddy Shiva kumar June 30, 2018

I am using Atlassian Stash v3.5.0, I have enabled the update serverside hook on Git, but unfortunately, this hook will not get executed when a pull request is merged.

The git stash we are using is of the third party and we do not have much control on it to install webhooks. Is there any way I can invoke the Jenkins job from git server using server-side hooks when pull request gets merged.

currently, I see the below hooks available on Git server.

update.sample
pre-rebase.sample
pre-push.sample
prepare-commit-msg.sample
pre-commit.sample
pre-applypatch.sample
post-update.sample
commit-msg.sample
applypatch-msg.sample
pre-receive.d
pre-receive
post-receive.d
post-receive

Thanks for your help

1 answer

1 accepted

0 votes
Answer accepted
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 30, 2018

Hi @Poreddy Shiva kumar,

In an upgrade to a more recent version of Stash (now known as Bitbucket Server) an option for you?

We recently introduced a set of Webhooks that can be triggered when particular events occur. These include the merge of a pull request.

 

By upgrading, you will also have access to the most recent version of the add-ons from the Atlassian Marketplace.

 

The details of the most recent versions of Bitbucket Server is available on the Bitbucket Server 5 release notes page.

 

Cheers,

Caterina - Atlassian

Poreddy Shiva kumar July 1, 2018

Hi @Caterina Curti

 

Thanks for your response but, at present, I don't have an option to upgrade stash because of business reasons. Is it possible to achieve this with the existing version without using webhooks and, with server-side hooks.

Shiva.

Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 3, 2018

Hi @Poreddy Shiva kumar,

Considering that the current version already reached its End of Life, I don't have a better solution to offer.

 

Please also note that any direct manipulation of the git repository available in the BITBUCKET_HOME directory is not supported.

 

Caterina

Poreddy Shiva kumar July 3, 2018

@Caterina Curti Thank you for your response. I will see other alternatives from the Jenkins.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events