Hi,
In other git environments, I'm able to have the git server perform a post-receive githook to push user branches out to the puppetmaster:/etc/puppet/environments/branchname.
Stash githook support is different so I'm running into an issue where I have not seen any good examples of this workflow.
Thanks,
Alan
Hi Charles,
External Hooks should work great for me. Is there a document of exposed environment variables that can be used in the plugin environment?
Thanks!
Alan
Hi Alan,
There are the three input parameters listed on the marketplace page:
Specified executables will receive "$from_ref $to_ref $ref_name" lines on stdin (see "man githooks").
For the environmental variables, the best place is to go directly to the source:
https://github.com/ngsru/atlassian-external-hooks/blob/master/src/main/java/com/ngs/stash/externalhooks/hook/ExternalPostReceiveHook.java#L55
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Alan, that helps.
One option would be to just use raw Git hooks, putting the SSH key on the filesystem somewhere. You could use the External Hooks plugin as a mechanism to launch the script if you want per-repository configuration.
Alternatively you could either the mirror plugin mentioned above, enabling HTTP on the puppet server, or setup an SSH mirror with the Mirror Manager.
Another option would be to send a webhook to the server, which listens on HTTP and then does the fetch that way.
Do any of those options sound appealing/useful?
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Charles,
I have old post-receive githooks that ssh from the git server to the puppet servers and perform a 'git pull'. Pretty basic stuff.
Alan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Charles,
I would like to push branches out to various servers and directories. Production, nonproduction and user server/dir pairs. I'm moving towards git-flow and trying to to figure out user branching and testing.
Thanks,
Alan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alan,
My apologies - I'm not all that familar with exact mechanics of Puppet. Can/does puppet do polling/fetching to receive updates? Or will you need to push to the puppet servers from Stash? If the latter is the mirror plugin linked above enough or if not then why?
Sorry for the 20 questions, I just need to understand exactly what you're trying to do.
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alan,
If you need to you can certainly use raw Git hooks on the Stash server. But otherwise, or in general, we recommend using our Repository Hooks:
https://developer.atlassian.com/stash/docs/latest/how-tos/repository-hooks.html
Forgive the naive question - are you just looking to mirror the repository to your puppet environment?
https://marketplace.atlassian.com/plugins/com.englishtown.stash-hook-mirror
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.