progrium/dokku — pull request #169 by Kloadut (2013-08-11 16:40:15+00:00)
Title: Add MariaDB plugin

MariaDB plugin
----------------------
I am submitting a pull-request but I guess it should stay as a "third-party" plugin.

You can see the usage at https://github.com/Kloadut/dokku-md-plugin
```
$ ssh dokku@server md:create foo
-----> PostgreSQL container created: md/foo

Host: 172.16.0.104
User: 'root'
Password: 'RDSBYlUrOYMtndKb'
Database: 'db'
Public port: 49187

$ git remote add dokku git@server:foo
$ git push dokku master
Counting objects: 155, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (155/155), 22.44 KiB | 0 bytes/s, done.
Total 155 (delta 92), reused 131 (delta 80)
remote: -----> Building foo ...
remote: Ruby/Rack app detected
remote: -----> Using Ruby version: ruby-2.0.0

... blah blah blah ...

remote: -----> Deploying foo ...
remote:
remote: -----> App foo linked to md/foo database
remote: DATABASE_URL=mysql://root:RDSBYlUrOYMtndKb@172.16.0.104/db
remote:
remote: -----> Deploy complete!
remote: -----> Cleaning up ...
remote: -----> Cleanup complete!
remote: =====> Application deployed:
remote: http://foo.server
```

Specifications
--------------------
* It builds a ubuntu quantal image with the following Dockerfiles https://github.com/Kloadut/dokku-md-dockerfiles
* It creates a container per DB, user is "root", database is "db" and password is generated
* It does **not** create database automatically, but it will look forward to see if a database is "linkable" (a.k.a with the same name)
* It uses the DATABASE_URL environment variable, saved in /home/git/myapp/ENV. See https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-ruby

See PostgreSQL equivalent: https://github.com/progrium/dokku/pull/166

**Note:** On my server it remains impacted by this bug https://github.com/progrium/pluginhook/issues/3

Enjoy !
Comments are welcome :)