This repository has been archived on 2020-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
dokku-ansible-deploy/DESIGN.md

2.1 KiB

design

!!! This is still a work in progress !!!

Overview

The end-user will create an application repository which will contain a number of files which match the autonomic dokku packaging format and will then create a dokku git remote and push to it. On the Dokku server side, this plugin, ansible-dokku-deploy, will intercept the dokku deployment process via the plugin interface and run a number of steps based on the standard dokku plugin triggers.

The idea is that the end-user will only need to specify a few configuration details like the listening port and some application specific details like which database to use and so on and then the plugin will take care to provision and deploy end-to-end the application with port mappings, TLS certificates, DNS entries, databases, automated backups and monitoring.

This plugin will use Ansible to handle the provisioning and deployment process because the Dokku maintainers are actively developing an Ansible library for this purpose and reduces maintenance burden of interacting with Dokku via the command-line which can be a bit tricky to script.

The workings of Ansible should be completely unknown to the end-user unless they need to arrange some custom deployment steps beyond the standard ones we define. That can unfortunately often be the case with complicated applications like Gitea which requires the host system to pass SSH connections through into the container but at least this plugin has shown that it can allow for such flexibility. So, advanced application packagers can leverage Ansible if they need it and for simple applications or pre-packaged applications, the work will already be done.

Triggers

post-extract

  1. Create a /var/lib/dokku/data/ansible/$APP folder
  2. Copy over nginx.conf.d folder
  3. Copy over vault folder and and env.yml file

pre-deploy

TODO.

post-deploy

TODO.