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

script to check the status of a hook

Kota Sreenivasa Shravana Kumar June 19, 2014

Does any one has a script or a plug-in which can fetch me the status ( enabled or disabled ) of a hook for a repository in STASH and preferably enable it or disable it from command line if there is a need ?

I basically wanted to collect report for all projects in STASH. we are using STASH 2.6.2 on a Linux encvironment. Let me know, if you need additional details. Thanks

1 answer

1 accepted

0 votes
Answer accepted
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2014

Hi,

You can use the REST endpoints to check and modify the status of hooks. See https://answers.atlassian.com/questions/284439/stash-checking-enablement-of-hook?page=1#284450

Cheers,

Michael

Kota Sreenivasa Shravana Kumar June 25, 2014

Michael,

Couple of questions.

1. Is there a plug-in which can restrict / prevent users to push derived objects such as *.exe, *.dll, *.so, *.jar etc ? These files can be derived out a build and there is no need to push them to repository. otherwise, it can fill the disk quickly.

2. How can I find such files which were already pushed to repos in Lunux ?

using a Linux find command or so.

2. How do I enable hooks project level or enable hooks as soon as project or repo gets created ?

Thanks

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2014

Is there a plug-in which can restrict / prevent users to push derived objects such as *.exe, *.dll, *.so, *.jar etc ? These files can be derived out a build and there is no need to push them to repository. otherwise, it can fill the disk quickly.

Stash doesn't bundle a hook like that and I don't remember seeing such a hook on marketplace either, but you can check: http://marketplace.atlassian.com. If you don't find such a hook, you can consider creating it yourself. Instructions on how to create repository hooks can be found on https://developer.atlassian.com/stash/docs/latest/how-tos/repository-hooks.html

How can I find such files which were already pushed to repos in Lunux ?

If you want to check on the server, it'll be tough. The git repositories on the server are bare repositories, which means that they have no checked out version of the repository. The easiest way to find out is to clone the repository and use 'find' to search for those extensions?

How do I enable hooks project level or enable hooks as soon as project or repo gets created ?

There currently is no built-in way to do that, but you could write a small plugin that listens for the ProjectCreatedEvent and/or RepositoryCreatedEvent and configure the hooks.

Kota Sreenivasa Shravana Kumar October 17, 2014

Michael, Can you provide your comments on this if you get sometime ? https://answers.atlassian.com/questions/9868611/git-authentication-issue-on-hp-ux Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events