<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Junglist Generation</title>
  <link href="http://junglist.gen.nz/atom.xml" rel="self"/>
  <link href="http://junglist.gen.nz/"/>
  <updated>2011-11-16T17:10:31+13:00</updated>
  <id>http://junglist.gen.nz/</id>
  <author>
    <name>AJ Christensen</name>
    
  </author>

  
  <entry>
    <title>Pennyworth Quick Start</title>
    <link href="http://junglist.gen.nz/blog/2011/11/16/pennyworth-quick-start/"/>
    <updated>2011-11-16T14:17:00+13:00</updated>
    <id>http://junglist.gen.nz/blog/2011/11/16/pennyworth-quick-start</id>
    <content type="html">&lt;p&gt;At &lt;a href=&quot;http://www.hw-ops.com/&quot;&gt;Heavy Water operations&lt;/a&gt; we have been
working on a Jenkins based continuous deployment system we've named
&lt;a href=&quot;https://github.com/heavywater/pennyworth&quot;&gt;Pennyworth&lt;/a&gt;. Should you choose to evaluate pennyworth, any project you
desire can be automatically tested, packaged and included in an appropriate repository
available for automated installation and deployment with APT
(hopefully via Chef!)&lt;/p&gt;

&lt;p&gt;This post will hopefully get you up and running in a
virtual environment, building the example jobs and walking through
each of the keys required to create a new job.&lt;/p&gt;

&lt;!--more--&gt;


&lt;h2&gt;Requirements&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;Ruby&lt;/a&gt; versions: 1.9.3-p0, 1.9.2-p290, 1.8.7-p352&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.virtualbox.org/wiki/Downloads&quot;&gt;VirtualBox 4.1.6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://download.virtualbox.org/virtualbox/4.1.6/Oracle_VM_VirtualBox_Extension_Pack-4.1.6-74713.vbox-extpack&quot;&gt;VirtualBox 4.1.6 Extension pack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;4GB RAM (tunable in Vagrantfile)&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Clone the repository&lt;/h3&gt;

&lt;p&gt;I'm using /tmp in this example.&lt;/p&gt;

&lt;pre&gt;
haxstation :: /tmp » hub clone heavywater/pennyworth
Cloning into pennyworth...
remote: Counting objects: 298, done.
remote: Compressing objects: 100% (179/179), done.
remote: Total 298 (delta 72), reused 295 (delta 69)
Receiving objects: 100% (298/298), 114.21 KiB, done.
Resolving deltas: 100% (72/72), done.
&lt;/pre&gt;


&lt;h3&gt;Installation of dependencies&lt;/h3&gt;

&lt;p&gt;Now that you have a clone you can begin installing the dependencies
with &lt;a href=&quot;http://gembundler.com&quot;&gt;Bundler&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;
haxstation :: /tmp/pennyworth ‹develop› » bundle install
Fetching source index for http://rubygems.org/
Installing archive-tar-minitar (0.5.2)
Installing erubis (2.7.0)
Installing ffi (1.0.10) with native extensions
Installing i18n (0.6.0)
Installing json (1.5.2) with native extensions
Installing net-ssh (2.1.4)
Installing net-scp (1.0.4)
Installing thor (0.14.6)
Installing virtualbox (0.9.2)
Installing vagrant (0.8.7)
Using bundler (1.0.21)
Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.
haxstation :: /tmp/pennyworth ‹develop› »
&lt;/pre&gt;


&lt;h3&gt;Tune Vagrant&lt;/h3&gt;

&lt;p&gt;With the dependencies all installed, you're ready to kick off
Vagrant. If you don't have 4GB of ram installed, open up the
&lt;code&gt;Vagrantfile&lt;/code&gt; and edit line #4, reducing the &lt;code&gt;vm.memory_size&lt;/code&gt; value:&lt;/p&gt;

&lt;p&gt;``` ruby&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Vagrant::Config.run do |config|
  config.vm.define :pennyworth do |pennyworth|
  pennyworth.vm.customize do |vm|
    vm.memory_size = 4096
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;h3&gt;Vagrant time&lt;/h3&gt;

&lt;p&gt;You're ready to launch Pennyworth!&lt;/p&gt;

&lt;p&gt;It takes 3000s+ on my &lt;a href=&quot;http://valid.canardpc.com/show_oc.php?id=2081675&quot;&gt;very hefty development workstation&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Intel i7-2600k @ 4.9 GHz (HT/WC)&lt;/li&gt;
&lt;li&gt;16GB RAM (Vagrant configured to use 8192MB)&lt;/li&gt;
&lt;li&gt;Intel 510 SSD&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Testing on EC2 has been much quicker due to bandwidth available provided you can afford the resource.&lt;/p&gt;

&lt;h4&gt;vagrant status&lt;/h4&gt;

&lt;pre&gt;
haxstation :: /tmp/pennyworth ‹develop› » bundle exec vagrant status
Current VM states

pennyworth               not created

The environment has not yet been created. Run `vagrant up` to
create the environment.
&lt;/pre&gt;


&lt;h4&gt;vagrant up&lt;/h4&gt;

&lt;pre&gt;
haxstation :: /tmp/pennyworth ‹develop› » bundle exec vagrant up
[pennyworth] Importing base box 'natty64'...
[pennyworth] Matching MAC address for NAT networking...
[pennyworth] Clearing any previously set forwarded ports...
[pennyworth] Forwarding ports...
[pennyworth] -- ssh: 22 =&gt; 2222 (adapter 1)
[pennyworth] -- web: 8080 =&gt; 8080 (adapter 1)
[pennyworth] Creating shared folders metadata...
[pennyworth] Running any VM customizations...
[pennyworth] Booting VM...
[pennyworth] Waiting for VM to boot. This can take a few minutes.
[pennyworth] VM booted and ready for use!
[pennyworth] Mounting shared folders...
[pennyworth] -- v-root: /vagrant
[pennyworth] -- v-csc-1: /tmp/vagrant-chef-1/chef-solo-1
[pennyworth] -- v-csr-2: /tmp/vagrant-chef-1/chef-solo-2
[pennyworth] -- v-csdb-3: /tmp/vagrant-chef-1/chef-solo-3
[pennyworth] Running provisioner: Vagrant::Provisioners::ChefSolo...
[pennyworth] Generating chef JSON and uploading...
[pennyworth] Running chef-solo...
...
&lt;/pre&gt;




&lt;pre&gt;
[pennyworth] [Wed, 16 Nov 2011 02:43:33 +0000] INFO: Chef Run complete
in 3482.654154 seconds
[pennyworth] [Wed, 16 Nov 2011 02:43:33 +0000] INFO: Running report
handlers
[pennyworth] [Wed, 16 Nov 2011 02:43:33 +0000] INFO: Report handlers
complete
haxstation :: /tmp/pennyworth ‹develop› »
&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;3482 seconds = 58.0333333 minutes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You'll want to avoid doing a full &lt;code&gt;vagrant destroy; vagrant up&lt;/code&gt; cycle
very often, unless you have a very fast connection.&lt;/p&gt;

&lt;h3&gt;Jenkins Dashboard&lt;/h3&gt;

&lt;p&gt;&lt;img class='' src='http://junglist.gen.nz/images/jenkins.png' width='' height='' alt='' title=''&gt;&lt;/p&gt;

&lt;h3&gt;Reprepro index&lt;/h3&gt;

&lt;p&gt;&lt;img class='' src='http://junglist.gen.nz/images/reprepro.png' width='' height='' alt='' title=''&gt;&lt;/p&gt;

&lt;h3&gt;Adding a pennyworth job with data bags&lt;/h3&gt;

&lt;p&gt;Here's the &lt;code&gt;ruby&lt;/code&gt; pennyworth job data bag included as an example:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt; (ruby.js)&lt;/span&gt; &lt;a href='http://junglist.gen.nz/downloads/code/ruby.js'&gt;download&lt;/a&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;span class='line'&gt;19&lt;/span&gt;
&lt;span class='line'&gt;20&lt;/span&gt;
&lt;span class='line'&gt;21&lt;/span&gt;
&lt;span class='line'&gt;22&lt;/span&gt;
&lt;span class='line'&gt;23&lt;/span&gt;
&lt;span class='line'&gt;24&lt;/span&gt;
&lt;span class='line'&gt;25&lt;/span&gt;
&lt;span class='line'&gt;26&lt;/span&gt;
&lt;span class='line'&gt;27&lt;/span&gt;
&lt;span class='line'&gt;28&lt;/span&gt;
&lt;span class='line'&gt;29&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;ruby&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;major&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;1.9&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;minor&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;3&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;project_type&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;package_from_git&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;git_branch&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;ruby_1_9_3&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;git_url&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;git://github.com/ruby/ruby.git&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;test_commands&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;autoconf&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;./configure --prefix=/usr/local --disable-install-doc&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;make test&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;build_commands&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;make install DESTDIR=\$DESTDIR&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;package_commands&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;mkdir -p fpm&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;cd fpm; fpm -s dir -t deb -n ruby1.9.3-full -v \$VERSION -C \$DESTDIR -p ruby1.9.3-full-VERSION_ARCH.deb --post-install /var/lib/jenkins/ldconfig usr/local/bin usr/local/include /usr/local/lib usr/local/share&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;sudo /usr/bin/reprepro -Vb /srv/apt includedeb \$LSB_CODENAME \$DESTDIR/ruby1.9.3-full-\$VERSION_*.deb&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;sudo /usr/local/bin/update_version.rb \$JOB_NAME \$VERSION&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;child_projects&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;s2&quot;&gt;&amp;quot;install-dependency-packages&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;remote_poll&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;clean&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &lt;span class=&quot;s2&quot;&gt;&amp;quot;wipeoutworkspace&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;Let's look at each of the keys.&lt;/p&gt;

&lt;h4&gt;version (&lt;em&gt;line 2 - 5&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  This key contains a hash that Pennyworth uses to construct a version
  number automatically, available to shell scripts during the build
  process as &lt;code&gt;$VERSION&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;  In this example, &lt;code&gt;$VERSION&lt;/code&gt; would be &lt;code&gt;1.9.3.$BUILD_NUMBER&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;project_type (&lt;em&gt;line 6&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  Controls which type of project pennyworth thinks this data bag item
  actually is.&lt;/p&gt;

&lt;p&gt;  In this example, the project type is &lt;em&gt;Package from Git&lt;/em&gt;, signifying
  that we will be continuously packaging a Git repository.&lt;/p&gt;

&lt;p&gt;  Other available project types are: &lt;code&gt;test_from_git&lt;/code&gt; which tests
  without packaging and &lt;code&gt;package&lt;/code&gt; which lacks the Git support -- we
  have used it to install legacy packages only available over HTTP.&lt;/p&gt;

&lt;p&gt;  This really only exists because a suitable abstraction hasn't been
  built around the jenkins_job LWRP yet, which we're planning on
  addressing shortly. Currently we pull all values out of the data bag
  and assign them (if available). &lt;a href=&quot;https://github.com/heavywater/pennyworth/blob/develop/cookbooks/pennyworth/recipes/default.rb#L71&quot;&gt;It's pretty gross&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;git_branch (&lt;em&gt;line 7&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  Used for the &lt;code&gt;*_from_git&lt;/code&gt; project types; controls which branch Jenkins
  will track for changes.&lt;/p&gt;

&lt;h4&gt;git_url (&lt;em&gt;line 8&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  Used for the &lt;code&gt;*_from_git&lt;/code&gt; project types; controls which remote Jenkins
  will track for changes.&lt;/p&gt;

&lt;h4&gt;test_commands (&lt;em&gt;line 9 - 13&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  An array of shell commands to run to start the testing off from a
  fresh checkout, so, potentially including autoconf and
  configure... Obviously hard to provide a catch all for this.&lt;/p&gt;

&lt;p&gt;  We have been considering an advanced build tool that can determine
  any and all appropriate commands required to kick this phase off.&lt;/p&gt;

&lt;h4&gt;build_commands (&lt;em&gt;line 14 - 16&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  An array of shell commands to run after testing to produce a
  compiled version of your project.&lt;/p&gt;

&lt;p&gt;  Bundler could be used during this phase to make pre-built Gem
  extensions, etc. available to the packaging phase. We've used this
  technique for Rails deployments in the past. Consequently, this is
  where build tools like Make, Rake and Leiningen have been used to
  produce compiled versions of many of our clients applications.&lt;/p&gt;

&lt;p&gt;  Our example uses the &lt;code&gt;$DESTDIR&lt;/code&gt; variable, which is generated by
  Jenkins as &lt;code&gt;$WORKSPACE/fpm&lt;/code&gt;; i.e. a sub directory in the
  workspace. This variable is available to all project types.&lt;/p&gt;

&lt;h4&gt;package_commands (&lt;em&gt;line 17 - 23&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  An array of shell commands to run after building a compiled version
  of the project.&lt;/p&gt;

&lt;p&gt;  Our example shows the steps required to package a directory with
  &lt;a href=&quot;https://github.com/jordansissel/fpm&quot;&gt;FPM&lt;/a&gt; and include them into the
  built in APT repository managed by &lt;a href=&quot;http://mirrorer.alioth.debian.org/&quot;&gt;Reprepro (previously known as mirrorer)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  It also makes use of our &lt;a href=&quot;https://github.com/heavywater/pennyworth/blob/develop/cookbooks/pennyworth/files/default/update_version.rb&quot;&gt;update_version.rb&lt;/a&gt; script which uses the
  Chef::DataBagItem class to update an item in the &lt;em&gt;package&lt;/em&gt;
  data-bag. We use this during deployment to figure out what versions
  of packages have been built by pennyworth.&lt;/p&gt;

&lt;p&gt;  This would be another great extension point for the build tool I
  hinted at earlier that could automatically determine what kind of
  files should be included into packages and manage the inclusion of
  the artifact in a repository.&lt;/p&gt;

&lt;p&gt;  We have used this section to launch notification and deployment
  tools that signal Chef to run over the network, including via SSH
  with the &lt;a href=&quot;https://github.com/heavywater/pennyworth/blob/develop/.chef/plugins/knife/deploy.rb&quot;&gt;Knife Deploy plugin&lt;/a&gt;
  which should be available as a gem soon.&lt;/p&gt;

&lt;h4&gt;child_projects (&lt;em&gt;line 24 - 26&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  An array of job names that this job is a parent of. Used to create
  dependencies/triggers between jobs.&lt;/p&gt;

&lt;h4&gt;remote_poll (&lt;em&gt;line 27&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  Enable or disable remote polling of the Git repository.&lt;/p&gt;

&lt;p&gt;  Setting this to false means the job will not poll Git, but can be
  triggered by API or the Web UI.&lt;/p&gt;

&lt;h4&gt;clean (&lt;em&gt;line 28&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  Enable or disable the cleaning of the workspace.&lt;/p&gt;

&lt;h4&gt;wipeoutworkspace (&lt;em&gt;line 29&lt;/em&gt;)&lt;/h4&gt;

&lt;p&gt;  Enable or disable the &quot;wiping out&quot; of the workspace, total
  removal. Probably not required with clean.&lt;/p&gt;

&lt;h3&gt;Questions?&lt;/h3&gt;

&lt;p&gt;Contact &lt;a href=&quot;https://twitter.com/fujin_&quot;&gt;AJ&lt;/a&gt; &lt;a href=&quot;&amp;#109;&amp;#x61;&amp;#x69;&amp;#x6c;&amp;#x74;&amp;#x6f;&amp;#x3a;&amp;#97;&amp;#x6a;&amp;#x40;&amp;#106;&amp;#117;&amp;#110;&amp;#x67;&amp;#x6c;&amp;#x69;&amp;#115;&amp;#x74;&amp;#x2e;&amp;#103;&amp;#101;&amp;#x6e;&amp;#46;&amp;#x6e;&amp;#x7a;&quot;&gt;&amp;#x61;&amp;#x6a;&amp;#x40;&amp;#106;&amp;#117;&amp;#110;&amp;#103;&amp;#108;&amp;#x69;&amp;#x73;&amp;#x74;&amp;#x2e;&amp;#x67;&amp;#x65;&amp;#110;&amp;#46;&amp;#110;&amp;#x7a;&lt;/a&gt; and
&lt;a href=&quot;https://twitter.com/dje&quot;&gt;Darrin&lt;/a&gt; &lt;a href=&quot;&amp;#109;&amp;#x61;&amp;#105;&amp;#108;&amp;#x74;&amp;#x6f;&amp;#x3a;&amp;#x64;&amp;#x61;&amp;#x72;&amp;#x72;&amp;#x69;&amp;#110;&amp;#x40;&amp;#104;&amp;#x65;&amp;#x61;&amp;#118;&amp;#121;&amp;#x77;&amp;#97;&amp;#x74;&amp;#101;&amp;#114;&amp;#46;&amp;#x63;&amp;#x61;&quot;&gt;&amp;#x64;&amp;#97;&amp;#x72;&amp;#114;&amp;#105;&amp;#110;&amp;#64;&amp;#104;&amp;#x65;&amp;#97;&amp;#118;&amp;#121;&amp;#x77;&amp;#x61;&amp;#116;&amp;#101;&amp;#x72;&amp;#x2e;&amp;#99;&amp;#x61;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.hw-ops.com/index.html&quot;&gt;Heavy Water operations&lt;/a&gt; has
sponsored and requisitioned the development, testing and
deployment of Pennyworth. Feel free to contact us to discuss more
complicated requirements, or any problems. No warranty implied =)&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>MiniTest Cookbook 0.0.5 Released</title>
    <link href="http://junglist.gen.nz/blog/2011/08/13/minitest-0-0-5-released/"/>
    <updated>2011-08-13T14:46:00+12:00</updated>
    <id>http://junglist.gen.nz/blog/2011/08/13/minitest-0-0-5-released</id>
    <content type="html">&lt;p&gt;A few days ago I released version 0.0.5 of the &lt;a href=&quot;https://github.com/fujin/minitest-cookbook&quot;&gt;MiniTest
Cookbook&lt;/a&gt; which included a
feature I've been working on that allows you to build MiniTest unit
test cases programmaticaly throughout the Chef run and have them
executed by a dedicated test runner.&lt;/p&gt;

&lt;p&gt;``` ruby&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;minitest_unit_testcase &quot;test something&quot; do
  block do
    refute_equal true, false, &quot;true is not false&quot;
    assert_equal true, true, &quot;true is not equal true
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;I've also retained the ability to run via Vagrant, for ease of
testing. The &lt;a href=&quot;https://github.com/fujin/minitest-cookbook/tree/develop&quot;&gt;develop branch&lt;/a&gt; has some more recent enhancements, notably
an in-line Sinatra server which I'm building example test cases
around.&lt;/p&gt;

&lt;pre&gt;
vagrant@vagrant:~$ sudo chef-solo -c /tmp/vagrant-chef-2/solo.rb -j
/tmp/vagrant-chef-2/dna.json
[Sat, 13 Aug 2011 03:03:58 +0000] INFO: *** Chef 0.10.2 ***
[Sat, 13 Aug 2011 03:03:58 +0000] INFO: Setting the run_list to
[&quot;recipe[minitest]&quot;, &quot;recipe[minitest::examples]&quot;] from JSON
[Sat, 13 Aug 2011 03:03:58 +0000] INFO: Run List is [recipe[minitest],
recipe[minitest::examples]]
[Sat, 13 Aug 2011 03:03:58 +0000] INFO: Run List expands to [minitest,
minitest::examples]
[Sat, 13 Aug 2011 03:03:58 +0000] INFO: Starting Chef Run for
vagrant.monkeybrains.net
[Sat, 13 Aug 2011 03:03:58 +0000] INFO: Processing
gem_package[minitest] action install (minitest::default line 19)
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: gem_package[minitest]
installed version ~&gt; 2.3.1
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Processing
gem_package[net-tftp] action install (minitest::default line 24)
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Chef Handlers will be at:
/tmp/handlers
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Processing
remote_directory[/tmp/handlers] action create (chef_handler::default
line 23)
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Processing
cookbook_file[/tmp/handlers/README] action create (dynamically
defined)
[Sat, 13 Aug 2011 03:04:08 +0000] INFO:
remote_directory[/tmp/handlers] created
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Processing
cookbook_file[/tmp/handlers/chefminitest.rb] action create
(minitest::default line 28)
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Processing
chef_handler[ChefMiniTest::Handler] action enable (minitest::default
line 29)
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Enabling
chef_handler[ChefMiniTest::Handler] as a report handler
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Enabling
chef_handler[ChefMiniTest::Handler] as a exception handler
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Processing
gem_package[sinatra] action install (minitest::examples line 1)
[Sat, 13 Aug 2011 03:04:08 +0000] INFO: Processing
gem_package[minitest] action install (minitest::default line 19)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: gem_package[minitest]
installed version ~&gt; 2.3.1
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
gem_package[net-tftp] action nothing (minitest::default line 24)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
remote_directory[/tmp/handlers] action nothing (chef_handler::default
line 23)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
cookbook_file[/tmp/handlers/chefminitest.rb] action create
(minitest::default line 28)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
chef_handler[ChefMiniTest::Handler] action nothing (minitest::default
line 29)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
gem_package[sinatra] action nothing (minitest::examples line 1)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
minitest_unit_testcase[test_truth] action create (minitest::examples
line 5)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
minitest_unit_testcase[test_http_port] action create
(minitest::examples line 55)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
minitest_unit_testcase[test_http_fitter_happier] action create
(minitest::examples line 55)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
minitest_unit_testcase[test_dns_resolution] action create
(minitest::examples line 55)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Processing
minitest_unit_testcase[test_tftp_binary_get] action create
(minitest::examples line 55)
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Chef Run complete in
10.741559696 seconds
[Sat, 13 Aug 2011 03:04:09 +0000] INFO: Running report handlers
Run options: -v --seed 59848

# Running tests:

[Sat, 13 Aug 2011 03:04:09 +0000] INFO: ChefMiniTestRunner starting
#&lt;Class:0x00000004570568&gt;#test_truth = 0.00 s = .
#&lt;Class:0x00000004570400&gt;#test_http_port = 0.00 s = E
#&lt;Class:0x00000004570298&gt;#test_http_fitter_happier = 0.00 s = E
#&lt;Class:0x00000004570130&gt;#test_dns_resolution = 0.03 s = E
#&lt;Class:0x0000000456ffc8&gt;#test_tftp_binary_get = 5.03 s = E
[Sat, 13 Aug 2011 03:04:14 +0000] INFO: ChefMiniTestRunner completed


Finished tests in 5.063267s, 0.9875 tests/s, 0.1975 assertions/s.

  1) Error:
test_http_port(#&lt;Class:0x00000004570400&gt;):
Errno::ECONNREFUSED: Connection refused - connect(2)
    /usr/local/lib/ruby/1.9.1/socket.rb:37:in `connect'
    /usr/local/lib/ruby/1.9.1/socket.rb:37:in `connect_internal'
    /usr/local/lib/ruby/1.9.1/socket.rb:86:in `connect'
    /usr/local/lib/ruby/1.9.1/socket.rb:247:in `block in tcp'
    /usr/local/lib/ruby/1.9.1/socket.rb:157:in `each'
    /usr/local/lib/ruby/1.9.1/socket.rb:157:in `foreach'
    /usr/local/lib/ruby/1.9.1/socket.rb:239:in `tcp'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:18:in
    `block in from_file'

  2) Error:
test_http_fitter_happier(#&lt;Class:0x00000004570298&gt;):
Errno::ECONNREFUSED: Connection refused - connect(2)
    /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `initialize'
    /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `open'
    /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `block in connect'
    /usr/local/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
    /usr/local/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
    /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `connect'
    /usr/local/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
    /usr/local/lib/ruby/1.9.1/net/http.rb:626:in `start'
    /usr/local/lib/ruby/1.9.1/net/http.rb:1168:in `request'
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.2/lib/chef/rest/rest_request.rb:84:in
    `block in call'
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.2/lib/chef/rest/rest_request.rb:99:in
    `hide_net_http_bug'
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.10.2/lib/chef/rest/rest_request.rb:83:in
    `call'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:30:in
    `block (3 levels) in from_file'
    /usr/local/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:29:in
    `block (2 levels) in from_file'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:26:in
    `each'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:26:in
    `block in from_file'

  3) Error:
test_dns_resolution(#&lt;Class:0x00000004570130&gt;):
Errno::ECONNREFUSED: Connection refused - recvfrom(2)
    /usr/local/lib/ruby/1.9.1/resolv.rb:747:in `recv'
    /usr/local/lib/ruby/1.9.1/resolv.rb:747:in `recv_reply'
    /usr/local/lib/ruby/1.9.1/resolv.rb:641:in `request'
    /usr/local/lib/ruby/1.9.1/resolv.rb:506:in `block in
    each_resource'
    /usr/local/lib/ruby/1.9.1/resolv.rb:1000:in `block (3 levels) in
    resolv'
    /usr/local/lib/ruby/1.9.1/resolv.rb:998:in `each'
    /usr/local/lib/ruby/1.9.1/resolv.rb:998:in `block (2 levels) in
    resolv'
    /usr/local/lib/ruby/1.9.1/resolv.rb:997:in `each'
    /usr/local/lib/ruby/1.9.1/resolv.rb:997:in `block in resolv'
    /usr/local/lib/ruby/1.9.1/resolv.rb:995:in `each'
    /usr/local/lib/ruby/1.9.1/resolv.rb:995:in `resolv'
    /usr/local/lib/ruby/1.9.1/resolv.rb:498:in `each_resource'
    /usr/local/lib/ruby/1.9.1/resolv.rb:391:in `each_address'
    /usr/local/lib/ruby/1.9.1/resolv.rb:367:in `getaddress'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:38:in
    `block in from_file'

  4) Error:
test_tftp_binary_get(#&lt;Class:0x0000000456ffc8&gt;):
Net::TFTPTimeout: execution expired
    /usr/local/lib/ruby/gems/1.9.1/gems/net-tftp-0.1.0/lib/net/tftp.rb:150:in
    `recvfrom'
    /usr/local/lib/ruby/gems/1.9.1/gems/net-tftp-0.1.0/lib/net/tftp.rb:150:in
    `block (2 levels) in getbinary'
    /usr/local/lib/ruby/gems/1.9.1/gems/net-tftp-0.1.0/lib/net/tftp.rb:149:in
    `loop'
    /usr/local/lib/ruby/gems/1.9.1/gems/net-tftp-0.1.0/lib/net/tftp.rb:149:in
    `block in getbinary'
    /usr/local/lib/ruby/gems/1.9.1/gems/net-tftp-0.1.0/lib/net/tftp.rb:148:in
    `getbinary'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:49:in
    `block (3 levels) in from_file'
    /usr/local/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:48:in
    `block (2 levels) in from_file'
    /usr/local/lib/ruby/1.9.1/tempfile.rb:320:in `open'
    /tmp/vagrant-chef-2/chef-solo-0/minitest/recipes/examples.rb:47:in
    `block in from_file'

5 tests, 1 assertions, 0 failures, 4 errors, 0 skips
[Sat, 13 Aug 2011 03:04:14 +0000] INFO: Report handlers complete
vagrant@vagrant:~$
&lt;/pre&gt;


&lt;p&gt;Test all the fucking time.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Time for Octopress</title>
    <link href="http://junglist.gen.nz/blog/2011/08/13/time-for-octopress/"/>
    <updated>2011-08-13T14:29:00+12:00</updated>
    <id>http://junglist.gen.nz/blog/2011/08/13/time-for-octopress</id>
    <content type="html">&lt;p&gt;I've installed octopress (which uses Jekyll under the hood) in a
terrible attempt to start blogging again. Here goes nothing.&lt;/p&gt;
</content>
  </entry>
  
</feed>

