Skip to main content

Heroku-style command line interface for Dokku

Project description

Note: This project is in the very early stages of development. You can help by adding commands (see below).

Installation

pip install dokku-client

Configuration

You can specify the Dokku host & app on the command line, but you may find it convenient to set the following environment variables instead:

export DOKKU_HOST=ubuntu@myserver.com
export DOKKU_APP=my-app-name

Setting these variables in your virtualenv’s postactivate hook may be useful.

Usage

Once installed, usage is simple:

dokku-client help

Produces:

Client for Dokku

usage:
    dokku-client <command> [<args>...]
    dokku-client help

global options:
    -H <host>, --host=<host>      Host address
    -a <app>, --app=<app>         App name

full list of available commands:

    prompt  Open a prompt
    help    Show this help message

See 'git help <command>' for more information on a specific command.

Contributing new commands

Dokku-client allows any developer to hook in extra commands. This is done using exactly the same mechanism that dokku-client uses internally, that of entry points provided by setuptools.

First, create a python package. You may have your own favorite way of doing this, but I use seed:

mkdir dokku-client-mycommand
cd dokku-client-mycommand
pip install seed
seed create
ls

Second, create a class which extends dokku_client.BaseCommand and implements the method main(args). Also, the doc-block at the top of the class will be used by docopt to parse any command line arguments, so make sure you include that. See the prompt command for an example.

And third, in your new setup.py file, specify your new class as an entry point:

entry_points={
    'dokku_client.commands': [
        'mycommand = dokku_client_mycommand.mycommand:MyCommand',
    ],
}

Run setup.py so that the new entry point is initialized:

# Run in develop mode, so files will not be copied away.
# You can continue to edit your code as usual
python setup.py develop

You should now find that your new command is available in dokku-client, run dokku-client help to check.

Once done, you can release your package to PyPi using seed release --initial.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dokku-client-0.2.1.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file dokku-client-0.2.1.tar.gz.

File metadata

File hashes

Hashes for dokku-client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 15a0b2a5f16ef06c11be8777c098fb2eb640a3ecd20d8df36981bc2d1be3046c
MD5 6b1f8150bd24a2ddc322f10736c60068
BLAKE2b-256 68f8c3bcc132824e1994c57e2a0778ba26f7c10136fc69139238606da351eacc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page