git-central icon indicating copy to clipboard operation
git-central copied to clipboard

Cleaned up the hudson-post-receive script

Open boxerab opened this issue 14 years ago • 4 comments

Hi Stephen, So, here is another version of the post receive script. I made the script work via either the command line, or called from another script: in my case, I do call it from the main post-receive script, along with a few other "post receive" scripts, and so I can't read the parameters in from command line or they won't be available to my other scripts. I have also made the hudson user name and password configurable. And, following your suggestion, I only read USER_EMAIL from git log if it has not been set.

Check it out and let me know what you think.

Cheers, Aaron

boxerab avatar Apr 21 '11 19:04 boxerab

Hi Aaron,

Thanks for revising the patch. I'm taking a look at integrating it. One question, for running multiple post receive scripts, did you see the sample file:

https://github.com/stephenh/git-central/blob/master/server/post-receive.sample

This lets you capture the stdin input into a variable and pass it along to multiple separate post-receive hooks. Would this achieve what you needed without the need for the hudson()? (Also, I don't see where newrev is set the way you're calling the script--it's used to conditionally get the email address. oldrev isn't currently used, but I think it'd be simpler to keep the script assuming it is passed the standard post-receive stdin input.)

stephenh avatar Apr 22 '11 16:04 stephenh

Cool, that echo trick would work. Also, yes, good idea to pass in all three post-receive inputs. I can make these changes on my fork, if you like. And test it on my Hudson server.

boxerab avatar Apr 22 '11 17:04 boxerab

That'd be great, Aaron, thanks.

stephenh avatar Apr 22 '11 17:04 stephenh

Hi Stephen, I've added another commit that cleans up post-receive-hudson. I've also taken the liberty of putting my actual post-receive script in the post-receive.sample file; I thought a working example would be useful. Also, I ended up leaving in the hudson() method, because I thought it would be more flexible to read either from command line and also stdin. So, I was curious about your reservations about using a function. Is it less portable?

Cheers, Aaron

boxerab avatar Apr 26 '11 18:04 boxerab