Habitat Plugins

Hi.

Most of you know Habitat Scaffolding feature. The feature is really useful, but it has known limitation: you can have only one scaffolding per package.

But what if I have multiple different build-patterns for my plan.sh? And I want to compose them. Similar approach I saw at Debian Packaging System: it has some deb-helpers to build git/svn/mercurial projects, build using maven/make/rake/whatever.

I believe pkg_plugins can be successor of pkg_scaffolding (https://github.com/habitat-sh/habitat/issues/6477).

Fortunately, Chef Habitat is flexible enough to work-around this. I’ve played and used plugins in my own project and can say I’m happy now.

I’m using community fork, but these plugins will work with Chef Habitat as is.

Let go through:

https://github.com/biome-sh/bio-plugin-secret - manages your secrets in .secrets/ automatically
https://github.com/biome-sh/bio-plugin-wrapper - automatically wrapps an upstream package, uses packages hooks, configs, exports, binding, etc unless defined in a wrapper
https://github.com/biome-sh/bio-plugin-git-source - allows use git url in pkg_source
https://github.com/biome-sh/bio-plugin-git - if project itself under git plugin helps to keep files clean by copying all files to CACHE_DIR before build. For example, no more maven target directories in source root.

All plugins load at do_setup_environment() callback. And all of them has lib/plugin.sh as main entry point.

What do you think?

2 Likes

This is some really cool work! Glad to see people innovating with the tools! I’d be curious to see if there’s enough community usage of these to warrant us trying to pull your work in upstream!