Github as a PPA alternative

When using puppet, software packages should be native to the OS you are provisioning. For example, you should use debian (.deb) packages on Ubuntu rather than zip files.

You can publish open source packages to public Debian repositories. Closed projects present a challenge; either pay for a binary repo or maintain your own PPA repository. Both Bintray and JFrog are expensive ranging between $45 and $300 per month. The effort in maintaining a private PPA is also quite high.

Github allows you to attach binary artifacts to your releases via their API. Since I am already paying $5/mo for a private github repository to manage my sourcecode, I thought I would get my moneys-worth. To that end, I have written a custom puppet module capable of pulling artifacts from tagged releases.

The module requires the following info:

  • github account name
  • project name
  • project version
  • github api key

The sourcecode for the module is available here: gitartifact.

Usage:

Just import the module like any other puppet module.

puppet module install danielburrell-gitartifact

Place this in your puppet manifest:

 gitartifact { "mygitartifact":
        account => "danielburrell",
        repository => "repo",
        releasetag => "0.0.2",
        pattern => "partialmatch.deb",
        oauth => "YOUR_OAUTH_TOKEN_HERE",
        destination => '/home/dan/gitartifact_0.0.1-SNAPSHOT.deb',
} 

You can chain package dependencies together with the gitartifact element.