jenkins workflow

77 views
Skip to first unread message

Bernard Clark

unread,
Aug 6, 2014, 12:17:18 PM8/6/14
to puppet...@googlegroups.com
I'm setting up a jenkins server to perform continuous integration on my puppet codebase, and I'm interested in running at least the following tests:
  • puppet parser validate
  • puppet lint
  • rspec-puppet
  • test-kitchen
Have I overlooked any other worthwhile tests, and has the community distilled any wisdom about best practices, particularly regarding git workflow? Any advice would be much appreciated!

Christopher Wood

unread,
Aug 6, 2014, 1:00:38 PM8/6/14
to puppet...@googlegroups.com
Also check to see that your templates compile and that ruby can read all your yaml files without erroring?

We just have the checks which we run intermittently, currently there's no snazzy integration beyond jenkins failing a run and us getting a sad email, and I have other priorities right now.

--------------------------------------------------
#!/bin/bash

. /usr/local/etc/re.conf

declare -i ret=0

for i in `find ${PPDIR} -name "*.erb"`; do
erb -P -x -T '-' $i | ruby -c >/dev/null
RETVAL=$?
ret=$(($ret + $RETVAL))
done

rm -f $FILE

exit $ret
--------------------------------------------------
#!/bin/bash

. /usr/local/etc/ry.conf

find $PPDIR -name "*.eyaml" >$FILE

/usr/local/bin/readyaml.rb $FILE
RETVAL=$?

rm -f $FILE

exit $RETVAL
--------------------------------------------------
#!/usr/bin/env ruby

require 'yaml'

listfile = ARGV[0]
list = File.read(listfile).split("\n")

list.each do |item|
data = File.read(item)
YAML.load(data)
end
--------------------------------------------------

They're pretty basic but the jenkins output leads us to the right place.


On Wed, Aug 06, 2014 at 09:17:18AM -0700, Bernard Clark wrote:
> I'm setting up a jenkins server to perform continuous integration on my
> puppet codebase, and I'm interested in running at least the following
> tests:
>
> * puppet parser validate
> * puppet lint
> * rspec-puppet
> * test-kitchen
>
> Have I overlooked any other worthwhile tests, and has the community
> distilled any wisdom about best practices, particularly regarding git
> workflow? Any advice would be much appreciated!
>
> --
> 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 [1]puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> [2]https://groups.google.com/d/msgid/puppet-users/ea52abae-4455-4ae4-9fc9-0f9cd3972a38%40googlegroups.com.
> For more options, visit [3]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:puppet-users...@googlegroups.com
> 2. https://groups.google.com/d/msgid/puppet-users/ea52abae-4455-4ae4-9fc9-0f9cd3972a38%40googlegroups.com?utm_medium=email&utm_source=footer
> 3. https://groups.google.com/d/optout

Atom Powers

unread,
Aug 6, 2014, 2:35:54 PM8/6/14
to puppet...@googlegroups.com
I've started to use beaker instead of test-kitchen, especially with docker instances.
This should let me test specific roles/profiles for functionality rather than just syntax correctness.


To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20140806170020.GA17370%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.



--
Perfection is just a word I use occasionally with mustard.
--Atom Powers--

John Warburton

unread,
Aug 6, 2014, 7:11:03 PM8/6/14
to puppet-users
On 7 August 2014 02:17, Bernard Clark <bernie...@gmail.com> wrote:
I'm setting up a jenkins server to perform continuous integration on my puppet codebase, and I'm interested in running at least the following tests:
  • puppet parser validate
  • puppet lint
These are cheap to do. Give yourself immediate feedback by making them pre commit hooks - http://puppetlabs.com/blog/how-set-git-commit-hooks-puppet-enterprise
  • rspec-puppet
  • test-kitchen
Have I overlooked any other worthwhile tests, and has the community distilled any wisdom about best practices, particularly regarding git workflow? Any advice would be much appreciated!
Look at server spec as well - http://serverspec.org/

John

Nick Cammorato

unread,
Aug 7, 2014, 8:11:42 AM8/7/14
to puppet...@googlegroups.com

Pre-commit hooks are great but Github and github enterprise won't enforce them(arbitrary code on the server is uncool for some reason), so if you want to be 100% and use either they still need to be run as part of your jenkins build task.

--
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...@googlegroups.com.

Jason Antman

unread,
Aug 13, 2014, 9:00:22 AM8/13/14
to puppet...@googlegroups.com
(1) a compile test is good, really good. make sure cheap tests happen first (and fail fast) before expensive ones.
(2) I have a strong bias for having the automated jobs just run "bundle exec rake test" or something like that, so that you can use the same job for multiple modules


Reply all
Reply to author
Forward
0 new messages