Skip to content

Instantly share code, notes, and snippets.

@kyzh
Forked from beddari/workshop.md
Last active August 29, 2015 14:14
Show Gist options
  • Save kyzh/c5653bb8fa98ff28adcc to your computer and use it in GitHub Desktop.
Save kyzh/c5653bb8fa98ff28adcc to your computer and use it in GitHub Desktop.

#cfgmgmtcamp #packaginglove workshop

What will you need?

  • A laptop with Vagrant installed
  • Willingness to ask questions and help others!

What will we do?

Part I

  • Configure our laptops to make them work as cross-distribution omnibus package building labs using bernd/fpm-cookery
  • Look at various simple example packages and try to build them

Break for coffee, early flights or possible boredom

Part II

  • Are there any projects we could make packages for?
  • Cooperate and see how far we get

Part 1

Installing tools

Skip any of these you already got covered. Consider helping out others that don't :)

Vagrant

No introduction needed. Grab the packages needed for your system if you happen to operate a laptop without Vagrant already on it. Strange you.

fpm-refinery

norcams/fpm-refinery is a quick cross-distro build lab on top of Vagrant that istelf is an omnibus-style package. It is built using the chef/bento baseboxes and postmodern/ruby-install

Clone it and try it out!

mkdir ~/workshop
cd ~/workshop
git clone http://github.com/norcams/fpm-refinery
cd fpm-refinery
vagrant status
vagrant up centos70 ubuntu1404

The provision.sh script in the project will download and install a distro-native package with a ruby stack and bernd/fpm-cookery on top. We'll use this to build packages.

If you look at the Vagrantfile you'll see that it shares the parent directory of the project. This is done to make it easy to check out packaging projects in the workshop folder and build them using the vagrant boxes.

Building packages

Now we're getting somewhere. Let's try and build some packages using fpm-cookery.

fail2ban

First, a simple non-omnibus package that solves a common problem for us - we don't always agree to how the distro has decided to do their packaging. For this you'll need the only the centos70 vagrant box, so we'll rebuild using only that one.

cd ~/workshop
git clone http://github.com/norcams/package-fail2ban
cd ~/workshop/fpm-refinery
vagrant destroy -f
vagrant up centos70
vagrant ssh centos70

Now, while inside the centos70 box we'll find the project we cloned in /vagrant/package-fail2ban and try to build it.

fpm-recipes

There are more examples of single, "normal" package builds in bernd/fpm-recipies, if you want, clone that repo and try to build some of them. They are mostly not cross-distro and will only build on Debian (or Ubuntu?) so you'll need to use those baseboxes.

cd ~/workshop
git clone http://github.com/bernd/fpm-recipes

puppet-omnibus

puppet-omnibus is a "hybrid" omnibus-package in that it mixes system-level packages and a build prefix of its own. This approach lets you choose what parts of the stack to manage internally and where to rely on external vendor or third party repositories.

cd ~/workshop
git clone http://github.com/andytinycat/puppet-omnibus
cd ~/workshop/fpm-refinery
vagrant destroy -f
vagrant up centos70 ubuntu1404

This project builds cross distro puppet packages. fpm-refinery does not have automatic building yet, so you'll have to enter each vagrant box manually and build, for now.

Wheew coffee break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment