bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

Implement Hiera lookups of recipe data from templated YAML files #150

Closed tomeon closed 8 years ago

tomeon commented 8 years ago

Phew! A mere one year and several weeks after #103, I'm back with a Hiera-based implementation of recipe data lookups. This is a big PR; here's an overview of the changes:

FPM::Cookery::Hiera

I also have additions for the wiki that provide documentation of public methods of interest. It appears there's no easy way to submit wiki PRs, though :(. While I figure something out, here's the Hiera page, and the updated Recipe Specification page.

Thanks in advance for considering this PR!

boc-tothefuture commented 8 years ago

This is pretty cool @BaxterStockman !

Two things I noticed while looking at it. (1) Should datadir be data_dir? The command line has it as --data-dir which seems inconsistent. (2) Is there a full example to look at? The wiki page indicates it points to one for redis.. But the item linked looks like a standard recipe to me?

Great work, btw! I think this will really lower the learning curve for people.

tomeon commented 8 years ago

Thanks, @brian-oconnell!

To point (1), agreed that it's a bit off, but I believe it follows the same convention as, e.g., the pkg directory, which is --pkg-dir on the command line, pkg_dir in config.rb, and pkgdir in recipe.rb. As to (2), I should have noted in my initial PR comment that the link is to the master branch of this repository and therefore doesn't point at the moment to a recipe that demonstrates Hiera in action. However, the new redis recipe and its supporting .yaml config files are viewable in the attached changeset.

Thanks again, and I too hope that this will make it even easier to cook packages with fpm-cookery! :)

bernd commented 8 years ago

Wow, thanks! I hope I will get to review and test this soon.

beddari commented 8 years ago

Yay, thanks for taking a shot at this!

boc-tothefuture commented 8 years ago

@BaxterStockman Trying to test out changes in your branch here.. It looks like you have simplecov as a regular dependency not development dependency. Can this be a development dependency? It broke my install of your version of the gem.

tomeon commented 8 years ago

@brian-oconnell -- thanks for catching that; it was an oversight caused by cut-n-paste from a gemspec for a gem that really does require simplecov at runtime. I will pull it out ASAP.

af6140 commented 8 years ago

When will we merge this pull request? externalizing recipe data is sweet.

bernd commented 8 years ago

I built some packages and there doesn't seem to be any breakage so far. I will merge this now and fix any issues later, if there are any.

Thank you very much for the PR! :smile:

I also have additions for the wiki that provide documentation of public methods of interest. It appears there's no easy way to submit wiki PRs, though :(

I started to write documentation in this repo which is published on readthedocs. See https://github.com/bernd/fpm-cookery#documentation for details.

davewongillies commented 7 years ago

@BaxterStockman :pray: I'd love some documentation please! I'm confused as to how hiera looks up different variables like in the example redis recipe and the existing documentation gives me no clues

tomeon commented 7 years ago

@davewongillies -- apologies for the late reply. I have been meaning to get around to translating the wiki docs I mentioned in the initial PR comment into reStructuredText. I expect to knock this out soon now that the holiday season is near.