It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

script to check the status of a hook

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 Jun 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

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 Jun 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.

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,218 views 1 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you