Home

Awesome

dokku

Build Status

This is a Chef cookbook which provides the ability to install and configure dokku. It provides a set of recipes and Lightweight Resource Providers (LWRPs) for managing apps and it's components.

It's pinned against a specific version of dokku to protect your installation against being accidentally broken. This marks a hold against the installed packages.

Usage

Recipes

Attributes

default

These optional settings can be overridden to customise the default Nginx configuration (which is used for all apps):

Data Bags

dokku_certificates

Used in combination with the dokku::certificates recipe, these allow for the management of SSL certificates apps. It's expected that they look like this:

{
  "id": "app-name",
  "cert": "",
  "key":
}

The id value should be the name of the app the certificate will set on. (The format is inspired by the certificate cookbook.)

LWRPs

ssh_key

Provides add and remove actions for setting the Dokku SSH public keys. Defaults to add. e.g.:

dokku_ssh_key "user" do
  key "ssh_public_key"
end

plugin

Provides install and uninstall actions for handling plugins. Defaults to install. e.g.:

dokku_plugin "redis" do
  url "https://github.com/dokku/dokku-redis.git"
end

app

Provides create, destroy and rename actions for managing Dokku apps. Defaults to create. e.g.:

dokku_app "demo"

certificate

Provides add and remove actions for managing Dokku certificates. Defaults to add: e.g.:

dokku_certificate "wildcard" do
  cert "An SSL Certificate as a string"
  key "An SSL Certificate's private key as a string"
end

The name of the action should be the id of an available data bag item.

Testing

ChefSpec is used for unit tests. Test Kitchen is used for integration tests, with serverspec.

# unit tests
chef exec rspec
# integration tests
KITCHEN_LOCAL_YAML=.kitchen.dokken.yml chef exec verify

Author

Copyright (c) Nick Charlton 2015. MIT licensed.