Hi: We want to switch our Puppet config repository from SVN to Git. Our SVN repository has a pre-commit hook that does a syntax check. If the check fails, the commit fails. With SVN that hook runs on the server so it''s easy to have (the correct version of) the puppet binary there for the hook to use. With Git it looks like the pre-commit hook has to run wherever a person happens to have checked out the Git repository. That could be a desktop, laptop...just about anywhere. It''s harder to make sure the correct version of Puppet is in all of those places. Is there a pretty way to solve this problem? How do you do it? Is there, perhaps, a way to create a standalone syntax checker that doesn''t require the rest of Puppet? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Julian Simpson
2009-Apr-23 11:01 UTC
[Puppet Users] Re: Syntax checking hook when using git?
A Continuous Integration server like Hudson will allow you to poll the GIT repo and make loud noises if the syntax check fails. J. 2009/4/23 Mark Plaksin <happy@usg.edu>:> > Hi: > > We want to switch our Puppet config repository from SVN to Git. Our SVN > repository has a pre-commit hook that does a syntax check. If the check > fails, the commit fails. With SVN that hook runs on the server so it''s > easy to have (the correct version of) the puppet binary there for the > hook to use. > > With Git it looks like the pre-commit hook has to run wherever a person > happens to have checked out the Git repository. That could be a > desktop, laptop...just about anywhere. It''s harder to make sure the > correct version of Puppet is in all of those places. > > Is there a pretty way to solve this problem? How do you do it? > > Is there, perhaps, a way to create a standalone syntax checker that > doesn''t require the rest of Puppet? > > Thanks! > > > > >-- Julian Simpson Software Build and Deployment http://www.build-doctor.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Eric Gerlach
2009-Apr-23 18:10 UTC
[Puppet Users] Re: Syntax checking hook when using git?
Also, since branching in git is so cheap, you can have the checkins go to a branch, and then check the syntax there. If they pass, then move them to production. Don''t know if Hudson supports this, but it''s what I''m in the process of doing right now. Cheers, Eric On Thu, Apr 23, 2009 at 12:01:33PM +0100, Julian Simpson wrote:> > A Continuous Integration server like Hudson will allow you to poll the > GIT repo and make loud noises if the syntax check fails. > > J. > > 2009/4/23 Mark Plaksin <happy@usg.edu>: > > > > Hi: > > > > We want to switch our Puppet config repository from SVN to Git. Our SVN > > repository has a pre-commit hook that does a syntax check. If the check > > fails, the commit fails. With SVN that hook runs on the server so it''s > > easy to have (the correct version of) the puppet binary there for the > > hook to use. > > > > With Git it looks like the pre-commit hook has to run wherever a person > > happens to have checked out the Git repository. That could be a > > desktop, laptop...just about anywhere. It''s harder to make sure the > > correct version of Puppet is in all of those places. > > > > Is there a pretty way to solve this problem? How do you do it? > > > > Is there, perhaps, a way to create a standalone syntax checker that > > doesn''t require the rest of Puppet? > > > > Thanks! > > > > > > > > > > > > > -- > Julian Simpson > Software Build and Deployment > http://www.build-doctor.com > > >-- Eric Gerlach, Network Administrator Federation of Students University of Waterloo p: (519) 888-4567 x36329 e: egerlach@feds.uwaterloo.ca --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Jean-Baptiste Quenot
2009-Apr-23 20:11 UTC
[Puppet Users] Re: Syntax checking hook when using git?
2009/4/23 Mark Plaksin <happy@usg.edu>:> > We want to switch our Puppet config repository from SVN to Git. Our SVN > repository has a pre-commit hook that does a syntax check. If the check > fails, the commit fails. With SVN that hook runs on the server so it''s > easy to have (the correct version of) the puppet binary there for the > hook to use. > > With Git it looks like the pre-commit hook has to run wherever a person > happens to have checked out the Git repository. That could be a > desktop, laptop...just about anywhere. It''s harder to make sure the > correct version of Puppet is in all of those places. > > Is there a pretty way to solve this problem? How do you do it?I would do this in the "update" hook of the central repository, so that it is invoked before changesets are pushed. -- Jean-Baptiste Quenot http://jbq.caraldi.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Plaksin
2009-Apr-30 20:31 UTC
[Puppet Users] Re: Syntax checking hook when using git?
Jean-Baptiste Quenot <jbq@caraldi.com> writes:> 2009/4/23 Mark Plaksin <happy@usg.edu>: > >> >> We want to switch our Puppet config repository from SVN to Git. Our SVN >> repository has a pre-commit hook that does a syntax check. If the check >> fails, the commit fails. With SVN that hook runs on the server so it''s >> easy to have (the correct version of) the puppet binary there for the >> hook to use. >> >> With Git it looks like the pre-commit hook has to run wherever a person >> happens to have checked out the Git repository. That could be a >> desktop, laptop...just about anywhere. It''s harder to make sure the >> correct version of Puppet is in all of those places. >> >> Is there a pretty way to solve this problem? How do you do it? > > I would do this in the "update" hook of the central repository, so > that it is invoked before changesets are pushed.Wow, thanks for the pointer! Are there nice examples of this sort of thing somewhere? I see how we can use ''git show --pretty=format:"%b" $newrev'' to get a diff of what''s being pushed. But once we have that, it seems like we have to apply the diff to an up-to-date checkout of the repo, figure out which files were added and changed and then run --parseonly against those files. All possible but it seems like there might be an easier way :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Plaksin
2009-May-21 13:04 UTC
[Puppet Users] Re: Syntax checking hook when using git?
Mark Plaksin <happy@usg.edu> writes:> Hi: > > We want to switch our Puppet config repository from SVN to Git. Our SVN > repository has a pre-commit hook that does a syntax check. If the check > fails, the commit fails. With SVN that hook runs on the server so it''s > easy to have (the correct version of) the puppet binary there for the > hook to use. > > With Git it looks like the pre-commit hook has to run wherever a person > happens to have checked out the Git repository. That could be a > desktop, laptop...just about anywhere. It''s harder to make sure the > correct version of Puppet is in all of those places. > > Is there a pretty way to solve this problem? How do you do it?Peff from Git Land helped us work out a server-side update hook that does the trick. I added it to the Wiki: http://reductivelabs.com/trac/puppet/wiki/Puppet%20Version%20Control --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---