Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Cleaned up the hudson-post-receive script #3

Open
wants to merge 7 commits into
from

Conversation

Projects
None yet
2 participants

boxerab commented Apr 21, 2011

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

Owner

stephenh commented Apr 22, 2011

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

boxerab commented Apr 22, 2011

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.

Owner

stephenh commented Apr 22, 2011

That'd be great, Aaron, thanks.

Aaron Boxer 1. post-receive is a real-world sample from my git repo - might be in…
…structive for users

2. added post-receive-redmine script, which pushes changes to redmine copy of repository
3. improved post-receive-hudson: added configurable parent job name and parent branch name,
where the parent job is used as a template to create new hudson jobs (for new branches)
d385043

boxerab commented Apr 26, 2011

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

Aaron Boxer added some commits Apr 26, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment