Hello all, I''m using puppet to deploy my codebase from GIT. I have everything working, but i currently don''t have any way to check to make sure there is actually something TO deploy before it goes through the entire process of deploying the code. I want to create a conditional that only re-deploys the code if the revision actually changed. So far, I can have it as part of the deploy process write the contents of ''git rev-parse HEAD'' to a file, this way I can do something like this from BASH: [ `cat git-current-hash` != `git rev-parse HEAD` ] which will return true only if there is a new revision to pull. The question is, how do I conditional include many different file {} and other things only if that condition is true? If this was just an exec{} I could use onlyif. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On Thursday, February 14, 2013 2:49:42 PM UTC-6, John Coggeshall wrote:> > Hello all, > > I''m using puppet to deploy my codebase from GIT. I have everything > working, but i currently don''t have any way to check to make sure there is > actually something TO deploy before it goes through the entire process of > deploying the code. I want to create a conditional that only re-deploys the > code if the revision actually changed. > > So far, I can have it as part of the deploy process write the contents of > ''git rev-parse HEAD'' to a file, this way I can do something like this from > BASH: > > [ `cat git-current-hash` != `git rev-parse HEAD` ] > > which will return true only if there is a new revision to pull. The > question is, how do I conditional include many different file {} and other > things only if that condition is true? If this was just an exec{} I could > use onlyif. > >One option would be to have a post-commit hook or something that pushes the code, instead of polling to pull the code.> John >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Hey, John. llowder''s recommendation is solid. There''s a write-up on how to accomplish the push/post-commit strategy here: https://puppetlabs.com/blog/git-workflow-and-puppet-environments/ -- --- Nathan Valentine - nathan@puppetlabs.com Puppet Labs Professional Services GV: 415.504.2173 Skype: nrvale0 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Puppet isn''t particularly good at code deployment. Ideally, you''d package your code, set a package resource to ensure => latest, then update your package repo with the new code. Then, all the resources that subscribe to that package (services, etc.) would be refreshed when the package gets updated in your repo. On Thursday, February 14, 2013 1:49:42 PM UTC-7, John Coggeshall wrote:> > Hello all, > > I''m using puppet to deploy my codebase from GIT. I have everything > working, but i currently don''t have any way to check to make sure there is > actually something TO deploy before it goes through the entire process of > deploying the code. I want to create a conditional that only re-deploys the > code if the revision actually changed. > > So far, I can have it as part of the deploy process write the contents of > ''git rev-parse HEAD'' to a file, this way I can do something like this from > BASH: > > [ `cat git-current-hash` != `git rev-parse HEAD` ] > > which will return true only if there is a new revision to pull. The > question is, how do I conditional include many different file {} and other > things only if that condition is true? If this was just an exec{} I could > use onlyif. > > John >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On Feb 14, 2013, at 7:04 PM, joe <lavaman@gmail.com> wrote:> Puppet isn''t particularly good at code deployment. Ideally, you''d package your code, set a package resource to ensure => latest, then update your package repo with the new code. Then, all the resources that subscribe to that package (services, etc.) would be refreshed when the package gets updated in your repo.Why do you say "Puppet isn''t particularly good at code deployment"? What you described seems perfectly reasonable. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On 15 February 2013 10:04, joe <lavaman@gmail.com> wrote:> Puppet isn''t particularly good at code deployment. Ideally, you''d package > your code, set a package resource to ensure => latest, then update your > package repo with the new code. Then, all the resources that subscribe to > that package (services, etc.) would be refreshed when the package gets > updated in your repo.I disagree. I use puppet for managing code deployments. I tend to use svn or git to roll it out because our internal software is a moving target and not well suited to packages and because it can be deployed multiple times on a node. Yes I realise I could use a package for that but I find it easier to use a source code management system. Updating is a simple process of updating one variable that specifies the tag to update to.> > On Thursday, February 14, 2013 1:49:42 PM UTC-7, John Coggeshall wrote: >> >> Hello all, >> >> I''m using puppet to deploy my codebase from GIT. I have everything >> working, but i currently don''t have any way to check to make sure there is >> actually something TO deploy before it goes through the entire process of >> deploying the code. I want to create a conditional that only re-deploys the >> code if the revision actually changed. >> >> So far, I can have it as part of the deploy process write the contents of >> ''git rev-parse HEAD'' to a file, this way I can do something like this from >> BASH: >> >> [ `cat git-current-hash` != `git rev-parse HEAD` ] >> >> which will return true only if there is a new revision to pull. The >> question is, how do I conditional include many different file {} and other >> things only if that condition is true? If this was just an exec{} I could >> use onlyif. >> >> John >> > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On 02/14/2013 07:25 PM, Peter Brown wrote:> On 15 February 2013 10:04, joe <lavaman@gmail.com> wrote: > >> Puppet isn''t particularly good at code deployment. Ideally, you''d package >> your code, set a package resource to ensure => latest, then update your >> package repo with the new code. Then, all the resources that subscribe to >> that package (services, etc.) would be refreshed when the package gets >> updated in your repo. > > I disagree. > I use puppet for managing code deployments. > I tend to use svn or git to roll it out because our internal software is a > moving target and not well suited to packages and because it can be > deployed multiple times on a node. > Yes I realise I could use a package for that but I find it easier to use a > source code management system. > Updating is a simple process of updating one variable that specifies the > tag to update to. > >Puppetforge has the vcsrepo module if you want to use the pull method: https://forge.puppetlabs.com/puppetlabs/vcsrepo I''m just not sure if "notify" works with it. Jason -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On 02/15/2013 01:11 AM, Brian Lalor wrote:>> Puppet isn''t particularly good at code deployment. Ideally, you''d >> package your code, set a package resource to ensure => latest, then >> update your package repo with the new code. Then, all the resources >> that subscribe to that package (services, etc.) would be refreshed >> when the package gets updated in your repo. > > Why do you say "Puppet isn''t particularly good at code deployment"? > What you described seems perfectly reasonable.I''m inclined to second Joe''s notion. Application deployment is usually a point-in-time thing. If you have the luxury to have your nodes deploy at times that are not clearly defined, you can resort to a puppet approach. If you *do* need orchestration, you probably apply an orchestration tool to the mix, and in this scenario, puppet is likely redundant. Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On 17 February 2013 01:34, Jason Edgecombe <jason@rampaginggeek.com> wrote:> On 02/14/2013 07:25 PM, Peter Brown wrote: > >> On 15 February 2013 10:04, joe <lavaman@gmail.com> wrote: >> >> Puppet isn''t particularly good at code deployment. Ideally, you''d package >>> your code, set a package resource to ensure => latest, then update your >>> package repo with the new code. Then, all the resources that subscribe to >>> that package (services, etc.) would be refreshed when the package gets >>> updated in your repo. >>> >> >> I disagree. >> I use puppet for managing code deployments. >> I tend to use svn or git to roll it out because our internal software is a >> moving target and not well suited to packages and because it can be >> deployed multiple times on a node. >> Yes I realise I could use a package for that but I find it easier to use a >> source code management system. >> Updating is a simple process of updating one variable that specifies the >> tag to update to. >> >> >> > Puppetforge has the vcsrepo module if you want to use the pull method: > https://forge.puppetlabs.com/**puppetlabs/vcsrepo<https://forge.puppetlabs.com/puppetlabs/vcsrepo> > > I''m just not sure if "notify" works with it.I was intending on having a look at vscrepo to see if i can get it to work with my setups. It looks pretty handy.> > Jason > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@**googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/**group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en> > . > For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> > . > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.