Hello,
External Hooks documentation is not reachable at the moment for this plugin:
https://marketplace.atlassian.com/plugins/com.ngs.stash.externalhooks.external-hooks
Is there another address or place to get the information?https://marketplace.atlassian.com/manage/plugins/com.ngs.stash.externalhooks.external-hooks/versions
Alternatively I am searching for that example shellscript mentioned on the plugins page to see all possible parameters.
Thanks, Max
Hi Max,
I'm not sure there is any documentation (I think that might be the default Marketplace location but I'm not sure).
You can see the parameters here:
https://github.com/ngsru/atlassian-external-hooks/blob/master/src/main/java/com/ngs/stash/externalhooks/hook/ExternalPreReceiveHook.java#L46
https://github.com/ngsru/atlassian-external-hooks/blob/master/src/main/java/com/ngs/stash/externalhooks/hook/ExternalPostReceiveHook.java#L39
You can see that the pre-receive has the advertised STASH_USER_NAME and STASH_USER_EMAIL values, but for some reason the post-receive doesn't (it would be easy enough to fix).
I've sent an email to the author to see if he can fix (or remove) that documentation link.
Charles
Hi Charles,
thanks for interventing and helping me with the author.
Poorly I am bad a reading that java code to get the parameters for post-recieve.
I see that it splits the input from stash line by line to get the args - but what are the possible parameters that can be set in stash?
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, apologies. I wasn't thinking. I've answered that here:
https://answers.atlassian.com/questions/222993/how-do-i-uses-external-hooks-with-positional-parameters
$1 = before hash
$2 = after hash
$3 = ref id (branch)
Does that help?
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Max!
I'm maintainer for this plugin. All positional arguments that you will specify in the hook configuration will passed as is to the script, no variable expansion in any kind will be made. However, script will be executed from git directory, so you have full access to the repository and can safely run such commands as "git diff" in your script.
I'm sorry for lack of docs and I'l fix it soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stanislav, and Charles again,
Thanks for your answers, I just tried some of the params I found or thought about and those always got sent plain without "parsing". Stanislav's answer gives me the same info - whatever is written in this box will just sent plain as parameters (each line one parameter).
Therefore i was thinking wrong (eg: REF_NAME would produce max.dev in the output).
Thanks for clearing up the fog ..
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can get REF_NAME by reading STDIN, like that (in bash):
while read from_sha to_sha ref_name; do echo $ref_name # do something with $ref_name done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can see that the pre-receive has the advertised STASH_USER_NAME and STASH_USER_EMAIL values, but for some reason the post-receive doesn't (it would be easy enough to fix).
Oh, I've simply forgot to commit, I'l fix it soon.
All documentation available for plugin at this moment is a description written under "Details" tab.
I will definitely write some documentation and fix that link, but it take some time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.