From 2cc04faf1996454cc0f2fc56241fdb95040cc468 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 14 May 2020 23:37:57 -0400 Subject: [PATCH] docs: document all flags in readme --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ bin/generate | 12 ++++++------ 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 717c001..887bfdb 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,14 @@ Help for any commands can be displayed by specifying the command as an argument dokku postgres:create [--create-flags...] ``` +flags: + +- `-C|--custom-env "USER=alpha;HOST=beta"`: semi-colon delimited environment variables to start the service with +- `-i|--image IMAGE`: the image name to start the service with +- `-I|--image-version IMAGE_VERSION`: the image version to start the service with +- `-p|--password PASSWORD`: override the user-level service password +- `-r|--root-password PASSWORD`: override the root-level service password + Create a postgres service named lolipop: ```shell @@ -91,6 +99,19 @@ dokku postgres:create lolipop dokku postgres:info [--single-info-flag] ``` +flags: + +- `--config-dir`: show the service configuration directory +- `--data-dir`: show the service data directory +- `--dsn`: show the service DSN +- `--exposed-ports`: show service exposed ports +- `--id`: show the service container id +- `--internal-ip`: show the service internal ip +- `--links`: show the service app links +- `--service-root`: show the service root directory +- `--status`: show the service running status +- `--version`: show the service image version + Get connection information as follows: ```shell @@ -132,6 +153,10 @@ dokku postgres:list dokku postgres:logs [-t|--tail] ``` +flags: + +- `-t|--tail`: do not stop when end of the logs are reached and wait for additional output + You can tail logs for a particular service: ```shell @@ -151,6 +176,11 @@ dokku postgres:logs lolipop --tail dokku postgres:link [--link-flags...] ``` +flags: + +- `-a|--alias "BLUE_DATABASE"`: an alternative alias to use for linking to an app via environment variable +- `-q|--querystring "pool=5"`: ampersand delimited querystring arguments to append to the service link + A postgres service can be linked to a container. This will use native docker links via the docker-options plugin. Here we link it to our 'playground' app. > NOTE: this will restart your app @@ -347,6 +377,13 @@ dokku postgres:restart lolipop dokku postgres:upgrade [--upgrade-flags...] ``` +flags: + +- `-C|--custom-env "USER=alpha;HOST=beta"`: semi-colon delimited environment variables to start the service with +- `-i|--image IMAGE`: the image name to start the service with +- `-I|--image-version IMAGE_VERSION`: the image version to start the service with +- `-R|--restart-apps "true"`: whether to force an app restart + You can upgrade an existing service to a new image or image-version: ```shell @@ -377,6 +414,14 @@ dokku postgres:app-links playground dokku postgres:clone [--clone-flags...] ``` +flags: + +- `-C|--custom-env "USER=alpha;HOST=beta"`: semi-colon delimited environment variables to start the service with +- `-i|--image IMAGE`: the image name to start the service with +- `-I|--image-version IMAGE_VERSION`: the image version to start the service with +- `-p|--password PASSWORD`: override the user-level service password +- `-r|--root-password PASSWORD`: override the root-level service password + You can clone an existing service to a new one: ```shell @@ -517,6 +562,10 @@ dokku postgres:backup-deauth lolipop dokku postgres:backup [--use-iam] ``` +flags: + +- `-u|--use-iam`: use the IAM profile associated with the current server + Backup the 'lolipop' service to the 'my-s3-bucket' bucket on aws: ```shell @@ -556,6 +605,10 @@ dokku postgres:backup-unset-encryption lolipop dokku postgres:backup-schedule [--use-iam] ``` +flags: + +- `-u|--use-iam`: use the IAM profile associated with the current server + Schedule a backup: > 'schedule' is a crontab expression, eg. "0 3 * * *" for each day at 3am diff --git a/bin/generate b/bin/generate index c8faa31..51eede0 100755 --- a/bin/generate +++ b/bin/generate @@ -226,12 +226,12 @@ def command_help(command, service, alias, scheme, ports, unimplemented): # for argument in data["arguments"]: # content.append(f"- {argument}") - # if len(data["flags"]) > 0: - # content.append("") - # content.append("flags:") - # content.append("") - # for flag in data["flags"]: - # content.append(f"- {flag}") + if len(data["flags"]) > 0: + content.append("") + content.append("flags:") + content.append("") + for flag in data["flags"]: + content.append(f"- {flag}") if len(data["examples"]) > 0: content.append("")