DokkuClient

weasel

Gem Version Code Climate Dependency Status

DokkuClient is solution for people who don't want to type every time something like

$ ssh -t dokku@my_host.com command app_name command

but just do

$ dokku command

This gem has built in commands for these plugins:

Installation

Install it yourself as:

$ gem install dokku_client

Configuration

$ dokku (for the first time in project)

$ dokku reconfig (to update config)

You will be asked for your dokku host and project name which will be stored in your application .git/config

Customize list of available commands

In 'active commands' question when you configuring dokku client type plugin name separated by comma and commands for this plugin will be visible in dokku help. Available plugins:

  • memcached
  • postgresl
  • mongodb
  • redis

Common and Config commands are enabled by default. If you don't answer to 'active commands' then all commands will be visible.

Show help

dokku help

or

dokku --help

Available commands (aliases to commands in brackets)

dokku

  Common commands:
    logs (l)                                  show app logs
    run (r) <command>                         run command (unfortunately fon now you have to type command in quotes)
    url (u)                                   show link to aplication
    plugins (p)                               show installed plugins on dokku host
    rc <env>                                  run rails console for application (pass 'staging' to load staging console, or leave empty for production)
    rdm                                       run database migrations

  Config commands:
    config (c)                                show environment variables for project
    get_config (gc) <KEY>                     show exact environment variable
    set_config (sc) KEY=VALUE [KEY2=VALUE2]   set new environment variables
    unset_config (uc) KEY [KEY2]              remove environment variables

  Memcached commands:
    create_mem                                create memcached container
    delete_mem                                delete memcached container
    info_mem                                  display container informations
    logs_mem                                  display last logs from memcached container
    link_mem <container>                      link an app to memcached container

  MongoDB commands:
    create_mongo                              create a mongo database
    delete_mongo                              delete a mongo database
    console_mongo                             lunch mongodb console as admin
    link_mongo                                link mongo container to application
    logs_mongo                                display logs for mongo container
    list_mongo                                list all mongo databases
    status_mongo                              display status of mongo container

  Postgresql commands:
    create_postgres <db>                      create a postgresql database
    delete_postgres <db>                      delete specified postgresql database
    info_postgres <db>                        display database information
    link_postgres <db>                        link an app to a postgresql container
    list_postgres <db>                        display list of postgresql containers
    logs_postgres                             display last logs from postgresql container

  Redis commands:
    create_redis                              create a redis container
    delete_redis                              delete redis container
    info_redis                                display container informations
    link_redis <container>                    link an app to a redis container
    logs_redis                                display last logs from redis container

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Thanks

This gem is inspired by https://github.com/lubieniebieski/pivo_flow. Thanks to it's author for the inspiration and idea.