docs: drop unimpemented commands from readme and reorganize
This commit is contained in:
168
README.md
168
README.md
@@ -35,7 +35,7 @@ mysql:exists <service> # check if the mysql service
|
|||||||
mysql:export <service> # export a dump of the mysql service database
|
mysql:export <service> # export a dump of the mysql service database
|
||||||
mysql:expose <service> <ports...> # expose a mysql service on custom port if provided (random port otherwise)
|
mysql:expose <service> <ports...> # expose a mysql service on custom port if provided (random port otherwise)
|
||||||
mysql:import <service> # import a dump into the mysql service database
|
mysql:import <service> # import a dump into the mysql service database
|
||||||
mysql:info <service> [--single-info-flag] # print the connection information
|
mysql:info <service> [--single-info-flag] # print the service information
|
||||||
mysql:link <service> <app> [--link-flags...] # link the mysql service to the app
|
mysql:link <service> <app> [--link-flags...] # link the mysql service to the app
|
||||||
mysql:linked <service> <app> # check if the mysql service is linked to an app
|
mysql:linked <service> <app> # check if the mysql service is linked to an app
|
||||||
mysql:links <service> # list all apps linked to the mysql service
|
mysql:links <service> # list all apps linked to the mysql service
|
||||||
@@ -55,20 +55,7 @@ mysql:upgrade <service> [--upgrade-flags...] # upgrade service <service> t
|
|||||||
Help for any commands can be displayed by specifying the command as an argument to mysql:help. Please consult the `mysql:help` command for any undocumented commands.
|
Help for any commands can be displayed by specifying the command as an argument to mysql:help. Please consult the `mysql:help` command for any undocumented commands.
|
||||||
|
|
||||||
### Basic Usage
|
### Basic Usage
|
||||||
### list all mysql services
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# usage
|
|
||||||
dokku mysql:list
|
|
||||||
```
|
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
List all services:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku mysql:list
|
|
||||||
```
|
|
||||||
### create a mysql service
|
### create a mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -76,15 +63,13 @@ dokku mysql:list
|
|||||||
dokku mysql:create <service> [--create-flags...]
|
dokku mysql:create <service> [--create-flags...]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Create a mysql service named lolipop:
|
Create a mysql service named lolipop:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:create lolipop
|
dokku mysql:create lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also specify the image and image version to use for the service. It *must* be compatible with the ${plugin_image} image. :
|
You can also specify the image and image version to use for the service. It *must* be compatible with the ${plugin_image} image.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
export DATABASE_IMAGE="${PLUGIN_IMAGE}"
|
export DATABASE_IMAGE="${PLUGIN_IMAGE}"
|
||||||
@@ -92,21 +77,20 @@ export DATABASE_IMAGE_VERSION="${PLUGIN_IMAGE_VERSION}"
|
|||||||
dokku mysql:create lolipop
|
dokku mysql:create lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also specify custom environment variables to start the mysql service in semi-colon separated form. :
|
You can also specify custom environment variables to start the mysql service in semi-colon separated form.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
export DATABASE_CUSTOM_ENV="USER=alpha;HOST=beta"
|
export DATABASE_CUSTOM_ENV="USER=alpha;HOST=beta"
|
||||||
dokku mysql:create lolipop
|
dokku mysql:create lolipop
|
||||||
```
|
```
|
||||||
### print the connection information
|
|
||||||
|
### print the service information
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# usage
|
# usage
|
||||||
dokku mysql:info <service> [--single-info-flag]
|
dokku mysql:info <service> [--single-info-flag]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Get connection information as follows:
|
Get connection information as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -127,6 +111,20 @@ dokku mysql:info lolipop --service-root
|
|||||||
dokku mysql:info lolipop --status
|
dokku mysql:info lolipop --status
|
||||||
dokku mysql:info lolipop --version
|
dokku mysql:info lolipop --version
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### list all mysql services
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# usage
|
||||||
|
dokku mysql:list
|
||||||
|
```
|
||||||
|
|
||||||
|
List all services:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku mysql:list
|
||||||
|
```
|
||||||
|
|
||||||
### print the most recent log(s) for this service
|
### print the most recent log(s) for this service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -134,8 +132,6 @@ dokku mysql:info lolipop --version
|
|||||||
dokku mysql:logs <service> [-t|--tail]
|
dokku mysql:logs <service> [-t|--tail]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
You can tail logs for a particular service:
|
You can tail logs for a particular service:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -147,6 +143,7 @@ By default, logs will not be tailed, but you can do this with the --tail flag:
|
|||||||
```shell
|
```shell
|
||||||
dokku mysql:logs lolipop --tail
|
dokku mysql:logs lolipop --tail
|
||||||
```
|
```
|
||||||
|
|
||||||
### link the mysql service to the app
|
### link the mysql service to the app
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -154,9 +151,7 @@ dokku mysql:logs lolipop --tail
|
|||||||
dokku mysql:link <service> <app> [--link-flags...]
|
dokku mysql:link <service> <app> [--link-flags...]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
A mysql 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.
|
||||||
|
|
||||||
A mysql 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
|
> NOTE: this will restart your app
|
||||||
|
|
||||||
@@ -187,7 +182,7 @@ The host exposed here only works internally in docker containers. If you want yo
|
|||||||
dokku mysql:link other_service playground
|
dokku mysql:link other_service playground
|
||||||
```
|
```
|
||||||
|
|
||||||
It is possible to change the protocol for database_url by setting the environment variable database_database_scheme on the app. Doing so will after linking will cause the plugin to think the service is not linked, and we advise you to unlink before proceeding. :
|
It is possible to change the protocol for database_url by setting the environment variable database_database_scheme on the app. Doing so will after linking will cause the plugin to think the service is not linked, and we advise you to unlink before proceeding.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku config:set playground DATABASE_DATABASE_SCHEME=mysql2
|
dokku config:set playground DATABASE_DATABASE_SCHEME=mysql2
|
||||||
@@ -199,6 +194,7 @@ This will cause database_url to be set as:
|
|||||||
```
|
```
|
||||||
mysql2://lolipop:SOME_PASSWORD@dokku-mysql-lolipop:3306/lolipop
|
mysql2://lolipop:SOME_PASSWORD@dokku-mysql-lolipop:3306/lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### unlink the mysql service from the app
|
### unlink the mysql service from the app
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -206,8 +202,6 @@ mysql2://lolipop:SOME_PASSWORD@dokku-mysql-lolipop:3306/lolipop
|
|||||||
dokku mysql:unlink <service> <app>
|
dokku mysql:unlink <service> <app>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
You can unlink a mysql service:
|
You can unlink a mysql service:
|
||||||
|
|
||||||
> NOTE: this will restart your app and unset related environment variables
|
> NOTE: this will restart your app and unset related environment variables
|
||||||
@@ -215,20 +209,6 @@ You can unlink a mysql service:
|
|||||||
```shell
|
```shell
|
||||||
dokku mysql:unlink lolipop playground
|
dokku mysql:unlink lolipop playground
|
||||||
```
|
```
|
||||||
### delete the mysql service/data/container if there are no links left
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# usage
|
|
||||||
dokku mysql:destroy <service> [-f|--force]
|
|
||||||
```
|
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Destroy the service, it's data, and the running container:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku mysql:destroy lolipop
|
|
||||||
```
|
|
||||||
|
|
||||||
### Service Lifecycle
|
### Service Lifecycle
|
||||||
|
|
||||||
@@ -241,13 +221,12 @@ The lifecycle of each service can be managed through the following commands:
|
|||||||
dokku mysql:connect <service>
|
dokku mysql:connect <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Connect to the service via the mysql connection tool:
|
Connect to the service via the mysql connection tool:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:connect lolipop
|
dokku mysql:connect lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### enter or run a command in a running mysql service container
|
### enter or run a command in a running mysql service container
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -255,19 +234,18 @@ dokku mysql:connect lolipop
|
|||||||
dokku mysql:enter <service>
|
dokku mysql:enter <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
A bash prompt can be opened against a running service. Filesystem changes will not be saved to disk.
|
||||||
|
|
||||||
A bash prompt can be opened against a running service. Filesystem changes will not be saved to disk. :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:enter lolipop
|
dokku mysql:enter lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
You may also run a command directly against the service. Filesystem changes will not be saved to disk. :
|
You may also run a command directly against the service. Filesystem changes will not be saved to disk.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:enter lolipop touch /tmp/test
|
dokku mysql:enter lolipop touch /tmp/test
|
||||||
```
|
```
|
||||||
|
|
||||||
### expose a mysql service on custom port if provided (random port otherwise)
|
### expose a mysql service on custom port if provided (random port otherwise)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -275,13 +253,12 @@ dokku mysql:enter lolipop touch /tmp/test
|
|||||||
dokku mysql:expose <service> <ports...>
|
dokku mysql:expose <service> <ports...>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Expose the service on the service's normal ports, allowing access to it from the public interface (0. 0. 0. 0):
|
Expose the service on the service's normal ports, allowing access to it from the public interface (0. 0. 0. 0):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:expose lolipop ${PLUGIN_DATASTORE_PORTS[@]}
|
dokku mysql:expose lolipop ${PLUGIN_DATASTORE_PORTS[@]}
|
||||||
```
|
```
|
||||||
|
|
||||||
### unexpose a previously exposed mysql service
|
### unexpose a previously exposed mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -289,13 +266,12 @@ dokku mysql:expose lolipop ${PLUGIN_DATASTORE_PORTS[@]}
|
|||||||
dokku mysql:unexpose <service>
|
dokku mysql:unexpose <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Unexpose the service, removing access to it from the public interface (0. 0. 0. 0):
|
Unexpose the service, removing access to it from the public interface (0. 0. 0. 0):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:unexpose lolipop
|
dokku mysql:unexpose lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### promote service <service> as DATABASE_URL in <app>
|
### promote service <service> as DATABASE_URL in <app>
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -303,8 +279,6 @@ dokku mysql:unexpose lolipop
|
|||||||
dokku mysql:promote <service> <app>
|
dokku mysql:promote <service> <app>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
If you have a mysql service linked to an app and try to link another mysql service another link environment variable will be generated automatically:
|
If you have a mysql service linked to an app and try to link another mysql service another link environment variable will be generated automatically:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -326,20 +300,7 @@ DATABASE_URL=mysql://other_service:ANOTHER_PASSWORD@dokku-mysql-other-service:33
|
|||||||
DOKKU_DATABASE_BLUE_URL=mysql://other_service:ANOTHER_PASSWORD@dokku-mysql-other-service:3306/other_service
|
DOKKU_DATABASE_BLUE_URL=mysql://other_service:ANOTHER_PASSWORD@dokku-mysql-other-service:3306/other_service
|
||||||
DOKKU_DATABASE_SILVER_URL=mysql://lolipop:SOME_PASSWORD@dokku-mysql-lolipop:3306/lolipop
|
DOKKU_DATABASE_SILVER_URL=mysql://lolipop:SOME_PASSWORD@dokku-mysql-lolipop:3306/lolipop
|
||||||
```
|
```
|
||||||
### graceful shutdown and restart of the mysql service container
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# usage
|
|
||||||
dokku mysql:restart <service>
|
|
||||||
```
|
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Restart the service:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dokku mysql:restart lolipop
|
|
||||||
```
|
|
||||||
### start a previously stopped mysql service
|
### start a previously stopped mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -347,13 +308,12 @@ dokku mysql:restart lolipop
|
|||||||
dokku mysql:start <service>
|
dokku mysql:start <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Start the service:
|
Start the service:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:start lolipop
|
dokku mysql:start lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### stop a running mysql service
|
### stop a running mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -361,13 +321,25 @@ dokku mysql:start lolipop
|
|||||||
dokku mysql:stop <service>
|
dokku mysql:stop <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Stop the service and the running container:
|
Stop the service and the running container:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:stop lolipop
|
dokku mysql:stop lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### graceful shutdown and restart of the mysql service container
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# usage
|
||||||
|
dokku mysql:restart <service>
|
||||||
|
```
|
||||||
|
|
||||||
|
Restart the service:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dokku mysql:restart lolipop
|
||||||
|
```
|
||||||
|
|
||||||
### upgrade service <service> to the specified versions
|
### upgrade service <service> to the specified versions
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -375,8 +347,6 @@ dokku mysql:stop lolipop
|
|||||||
dokku mysql:upgrade <service> [--upgrade-flags...]
|
dokku mysql:upgrade <service> [--upgrade-flags...]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
You can upgrade an existing service to a new image or image-version:
|
You can upgrade an existing service to a new image or image-version:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -394,13 +364,12 @@ Service scripting can be executed using the following commands:
|
|||||||
dokku mysql:app-links <app>
|
dokku mysql:app-links <app>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
List all mysql services that are linked to the 'playground' app.
|
||||||
|
|
||||||
List all mysql services that are linked to the 'playground' app. :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:app-links playground
|
dokku mysql:app-links playground
|
||||||
```
|
```
|
||||||
|
|
||||||
### create container <new-name> then copy data from <name> into <new-name>
|
### create container <new-name> then copy data from <name> into <new-name>
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -408,13 +377,12 @@ dokku mysql:app-links playground
|
|||||||
dokku mysql:clone <service> <new-service> [--clone-flags...]
|
dokku mysql:clone <service> <new-service> [--clone-flags...]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
You can clone an existing service to a new one:
|
You can clone an existing service to a new one:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:clone lolipop lolipop-2
|
dokku mysql:clone lolipop lolipop-2
|
||||||
```
|
```
|
||||||
|
|
||||||
### check if the mysql service exists
|
### check if the mysql service exists
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -422,13 +390,12 @@ dokku mysql:clone lolipop lolipop-2
|
|||||||
dokku mysql:exists <service>
|
dokku mysql:exists <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
Here we check if the lolipop mysql service exists.
|
||||||
|
|
||||||
Here we check if the lolipop mysql service exists. :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:exists lolipop
|
dokku mysql:exists lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### check if the mysql service is linked to an app
|
### check if the mysql service is linked to an app
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -436,13 +403,12 @@ dokku mysql:exists lolipop
|
|||||||
dokku mysql:linked <service> <app>
|
dokku mysql:linked <service> <app>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
Here we check if the lolipop mysql service is linked to the 'playground' app.
|
||||||
|
|
||||||
Here we check if the lolipop mysql service is linked to the 'playground' app. :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:linked lolipop playground
|
dokku mysql:linked lolipop playground
|
||||||
```
|
```
|
||||||
|
|
||||||
### list all apps linked to the mysql service
|
### list all apps linked to the mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -450,9 +416,7 @@ dokku mysql:linked lolipop playground
|
|||||||
dokku mysql:links <service>
|
dokku mysql:links <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
List all apps linked to the 'lolipop' mysql service.
|
||||||
|
|
||||||
List all apps linked to the 'lolipop' mysql service. :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:links lolipop
|
dokku mysql:links lolipop
|
||||||
@@ -469,13 +433,12 @@ The underlying service data can be imported and exported with the following comm
|
|||||||
dokku mysql:import <service>
|
dokku mysql:import <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Import a datastore dump:
|
Import a datastore dump:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:import lolipop < database.dump
|
dokku mysql:import lolipop < database.dump
|
||||||
```
|
```
|
||||||
|
|
||||||
### export a dump of the mysql service database
|
### export a dump of the mysql service database
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -483,8 +446,6 @@ dokku mysql:import lolipop < database.dump
|
|||||||
dokku mysql:export <service>
|
dokku mysql:export <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
By default, datastore output is exported to stdout:
|
By default, datastore output is exported to stdout:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -512,8 +473,6 @@ Backups can be performed using the backup commands:
|
|||||||
dokku mysql:backup-auth <service> <aws-access-key-id> <aws-secret-access-key> <aws-default-region> <aws-signature-version> <endpoint-url>
|
dokku mysql:backup-auth <service> <aws-access-key-id> <aws-secret-access-key> <aws-default-region> <aws-signature-version> <endpoint-url>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Setup s3 backup authentication:
|
Setup s3 backup authentication:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -537,6 +496,7 @@ More specific example for minio auth:
|
|||||||
```shell
|
```shell
|
||||||
dokku mysql:backup-auth lolipop MINIO_ACCESS_KEY_ID MINIO_SECRET_ACCESS_KEY us-east-1 s3v4 https://YOURMINIOSERVICE
|
dokku mysql:backup-auth lolipop MINIO_ACCESS_KEY_ID MINIO_SECRET_ACCESS_KEY us-east-1 s3v4 https://YOURMINIOSERVICE
|
||||||
```
|
```
|
||||||
|
|
||||||
### removes backup authentication for the mysql service
|
### removes backup authentication for the mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -544,13 +504,12 @@ dokku mysql:backup-auth lolipop MINIO_ACCESS_KEY_ID MINIO_SECRET_ACCESS_KEY us-e
|
|||||||
dokku mysql:backup-deauth <service>
|
dokku mysql:backup-deauth <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Remove s3 authentication:
|
Remove s3 authentication:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:backup-deauth lolipop
|
dokku mysql:backup-deauth lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### creates a backup of the mysql service to an existing s3 bucket
|
### creates a backup of the mysql service to an existing s3 bucket
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -558,13 +517,12 @@ dokku mysql:backup-deauth lolipop
|
|||||||
dokku mysql:backup <service> <bucket-name> [--use-iam]
|
dokku mysql:backup <service> <bucket-name> [--use-iam]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Backup the 'lolipop' service to the 'my-s3-bucket' bucket on aws:
|
Backup the 'lolipop' service to the 'my-s3-bucket' bucket on aws:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:backup lolipop my-s3-bucket --use-iam
|
dokku mysql:backup lolipop my-s3-bucket --use-iam
|
||||||
```
|
```
|
||||||
|
|
||||||
### sets encryption for all future backups of mysql service
|
### sets encryption for all future backups of mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -572,13 +530,12 @@ dokku mysql:backup lolipop my-s3-bucket --use-iam
|
|||||||
dokku mysql:backup-set-encryption <service> <passphrase>
|
dokku mysql:backup-set-encryption <service> <passphrase>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Set a gpg passphrase for backups:
|
Set a gpg passphrase for backups:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:backup-set-encryption lolipop
|
dokku mysql:backup-set-encryption lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### unsets encryption for future backups of the mysql service
|
### unsets encryption for future backups of the mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -586,13 +543,12 @@ dokku mysql:backup-set-encryption lolipop
|
|||||||
dokku mysql:backup-unset-encryption <service>
|
dokku mysql:backup-unset-encryption <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Unset a gpg encryption key for backups:
|
Unset a gpg encryption key for backups:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:backup-unset-encryption lolipop
|
dokku mysql:backup-unset-encryption lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### schedules a backup of the mysql service
|
### schedules a backup of the mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -600,8 +556,6 @@ dokku mysql:backup-unset-encryption lolipop
|
|||||||
dokku mysql:backup-schedule <service> <schedule> <bucket-name> [--use-iam]
|
dokku mysql:backup-schedule <service> <schedule> <bucket-name> [--use-iam]
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Schedule a backup:
|
Schedule a backup:
|
||||||
|
|
||||||
> 'schedule' is a crontab expression, eg. "0 3 * * *" for each day at 3am
|
> 'schedule' is a crontab expression, eg. "0 3 * * *" for each day at 3am
|
||||||
@@ -615,6 +569,7 @@ Schedule a backup and authenticate via iam:
|
|||||||
```shell
|
```shell
|
||||||
dokku mysql:backup-schedule lolipop "0 3 * * *" my-s3-bucket --use-iam
|
dokku mysql:backup-schedule lolipop "0 3 * * *" my-s3-bucket --use-iam
|
||||||
```
|
```
|
||||||
|
|
||||||
### cat the contents of the configured backup cronfile for the service
|
### cat the contents of the configured backup cronfile for the service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -622,13 +577,12 @@ dokku mysql:backup-schedule lolipop "0 3 * * *" my-s3-bucket --use-iam
|
|||||||
dokku mysql:backup-schedule-cat <service>
|
dokku mysql:backup-schedule-cat <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Cat the contents of the configured backup cronfile for the service:
|
Cat the contents of the configured backup cronfile for the service:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku mysql:backup-schedule-cat lolipop
|
dokku mysql:backup-schedule-cat lolipop
|
||||||
```
|
```
|
||||||
|
|
||||||
### unschedules the backup of the mysql service
|
### unschedules the backup of the mysql service
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -636,8 +590,6 @@ dokku mysql:backup-schedule-cat lolipop
|
|||||||
dokku mysql:backup-unschedule <service>
|
dokku mysql:backup-unschedule <service>
|
||||||
```
|
```
|
||||||
|
|
||||||
examples:
|
|
||||||
|
|
||||||
Remove the scheduled backup from cron:
|
Remove the scheduled backup from cron:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
155
bin/generate
155
bin/generate
@@ -5,6 +5,17 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
def compile(service, version, alias, scheme, ports, unimplemented, dokku_version):
|
||||||
|
return "\n\n".join([
|
||||||
|
header(service),
|
||||||
|
description(service, version),
|
||||||
|
requirements_section(dokku_version),
|
||||||
|
installation_section(service, dokku_version),
|
||||||
|
commands_section(service, alias, scheme, ports, unimplemented),
|
||||||
|
usage_section(service, alias, scheme, ports, unimplemented),
|
||||||
|
]).replace("\n\n\n\n\n", "\n").replace("\n\n\n\n", "\n").replace("\n\n\n", "\n\n")
|
||||||
|
|
||||||
|
|
||||||
def header(service):
|
def header(service):
|
||||||
return " ".join([
|
return " ".join([
|
||||||
f"# dokku {service}",
|
f"# dokku {service}",
|
||||||
@@ -17,7 +28,7 @@ def description(service, version):
|
|||||||
return f"Official {service} plugin for dokku. Currently defaults to installing [{service} {version}](https://hub.docker.com/_/{service}/)."
|
return f"Official {service} plugin for dokku. Currently defaults to installing [{service} {version}](https://hub.docker.com/_/{service}/)."
|
||||||
|
|
||||||
|
|
||||||
def requirements(dokku_version):
|
def requirements_section(dokku_version):
|
||||||
return "\n".join([
|
return "\n".join([
|
||||||
"## Requirements",
|
"## Requirements",
|
||||||
"",
|
"",
|
||||||
@@ -26,7 +37,7 @@ def requirements(dokku_version):
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
def installation(service, dokku_version):
|
def installation_section(service, dokku_version):
|
||||||
return "\n".join([
|
return "\n".join([
|
||||||
"## Installation",
|
"## Installation",
|
||||||
"",
|
"",
|
||||||
@@ -37,7 +48,7 @@ def installation(service, dokku_version):
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
def commands(service, alias, scheme, ports):
|
def commands_section(service, alias, scheme, ports, unimplemented):
|
||||||
content = [
|
content = [
|
||||||
"## Commands",
|
"## Commands",
|
||||||
"",
|
"",
|
||||||
@@ -50,6 +61,8 @@ def commands(service, alias, scheme, ports):
|
|||||||
command_list = []
|
command_list = []
|
||||||
descriptions = []
|
descriptions = []
|
||||||
for filename in subcommands:
|
for filename in subcommands:
|
||||||
|
if filename in unimplemented:
|
||||||
|
continue
|
||||||
data = command_data(filename, service, alias, scheme, ports)
|
data = command_data(filename, service, alias, scheme, ports)
|
||||||
description = data["description"]
|
description = data["description"]
|
||||||
arguments = data["arguments_string"]
|
arguments = data["arguments_string"]
|
||||||
@@ -68,77 +81,65 @@ def commands(service, alias, scheme, ports):
|
|||||||
return "\n".join(content)
|
return "\n".join(content)
|
||||||
|
|
||||||
|
|
||||||
def usage(service, alias, scheme, ports):
|
def usage_section(service, alias, scheme, ports, unimplemented):
|
||||||
return "\n\n".join([
|
return "\n\n".join([
|
||||||
"## Usage",
|
"## Usage",
|
||||||
f"Help for any commands can be displayed by specifying the command as an argument to {service}:help. Please consult the `{service}:help` command for any undocumented commands.",
|
f"Help for any commands can be displayed by specifying the command as an argument to {service}:help. Please consult the `{service}:help` command for any undocumented commands.",
|
||||||
usage_intro(service, alias, scheme, ports),
|
usage_intro(service, alias, scheme, ports, unimplemented),
|
||||||
usage_lifecycle(service, alias, scheme, ports),
|
usage_lifecycle(service, alias, scheme, ports, unimplemented),
|
||||||
usage_automation(service, alias, scheme, ports),
|
usage_automation(service, alias, scheme, ports, unimplemented),
|
||||||
usage_data_management(service, alias, scheme, ports),
|
usage_data_management(service, alias, scheme, ports, unimplemented),
|
||||||
usage_backup(service, alias, scheme, ports),
|
usage_backup(service, alias, scheme, ports, unimplemented),
|
||||||
usage_docker_pull(service, alias, scheme, ports),
|
usage_docker_pull(service, alias, scheme, ports, unimplemented),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
def usage_intro(service, alias, scheme, ports):
|
def usage_intro(service, alias, scheme, ports, unimplemented):
|
||||||
return "\n".join([
|
commands = ["create", "info", "list", "logs", "link", "unlink"]
|
||||||
"### Basic Usage",
|
content = ["### Basic Usage"]
|
||||||
command_help("list", service, alias, scheme, ports),
|
|
||||||
command_help("create", service, alias, scheme, ports),
|
return fetch_commands_content(service, alias, scheme, ports, unimplemented, commands, content)
|
||||||
command_help("info", service, alias, scheme, ports),
|
|
||||||
command_help("logs", service, alias, scheme, ports),
|
|
||||||
command_help("link", service, alias, scheme, ports),
|
|
||||||
command_help("unlink", service, alias, scheme, ports),
|
|
||||||
command_help("destroy", service, alias, scheme, ports),
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
def usage_lifecycle(service, alias, scheme, ports):
|
def usage_lifecycle(service, alias, scheme, ports, unimplemented):
|
||||||
return "\n".join([
|
commands = ["connect", "enter", "expose", "unexpose", "promote", "start", "stop", "restart", "upgrade"]
|
||||||
|
content = [
|
||||||
"### Service Lifecycle",
|
"### Service Lifecycle",
|
||||||
"",
|
"",
|
||||||
"The lifecycle of each service can be managed through the following commands:",
|
"The lifecycle of each service can be managed through the following commands:",
|
||||||
"",
|
"",
|
||||||
command_help("connect", service, alias, scheme, ports),
|
]
|
||||||
command_help("enter", service, alias, scheme, ports),
|
|
||||||
command_help("expose", service, alias, scheme, ports),
|
return fetch_commands_content(service, alias, scheme, ports, unimplemented, commands, content)
|
||||||
command_help("unexpose", service, alias, scheme, ports),
|
|
||||||
command_help("promote", service, alias, scheme, ports),
|
|
||||||
command_help("restart", service, alias, scheme, ports),
|
|
||||||
command_help("start", service, alias, scheme, ports),
|
|
||||||
command_help("stop", service, alias, scheme, ports),
|
|
||||||
command_help("upgrade", service, alias, scheme, ports),
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
def usage_automation(service, alias, scheme, ports):
|
def usage_automation(service, alias, scheme, ports, unimplemented):
|
||||||
return "\n".join([
|
commands = ["app-links", "clone", "exists", "linked", "links"]
|
||||||
|
content = [
|
||||||
"### Service Automation",
|
"### Service Automation",
|
||||||
"",
|
"",
|
||||||
"Service scripting can be executed using the following commands:",
|
"Service scripting can be executed using the following commands:",
|
||||||
"",
|
"",
|
||||||
command_help("app-links", service, alias, scheme, ports),
|
]
|
||||||
command_help("clone", service, alias, scheme, ports),
|
|
||||||
command_help("exists", service, alias, scheme, ports),
|
return fetch_commands_content(service, alias, scheme, ports, unimplemented, commands, content)
|
||||||
command_help("linked", service, alias, scheme, ports),
|
|
||||||
command_help("links", service, alias, scheme, ports),
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
def usage_data_management(service, alias, scheme, ports):
|
def usage_data_management(service, alias, scheme, ports, unimplemented):
|
||||||
return "\n".join([
|
commands = ["import", "export"]
|
||||||
|
content = [
|
||||||
"### Data Management",
|
"### Data Management",
|
||||||
"",
|
"",
|
||||||
"The underlying service data can be imported and exported with the following commands:",
|
"The underlying service data can be imported and exported with the following commands:",
|
||||||
"",
|
"",
|
||||||
command_help("import", service, alias, scheme, ports),
|
]
|
||||||
command_help("export", service, alias, scheme, ports),
|
|
||||||
])
|
return fetch_commands_content(service, alias, scheme, ports, unimplemented, commands, content)
|
||||||
|
|
||||||
|
|
||||||
def usage_backup(service, alias, scheme, ports):
|
def usage_backup(service, alias, scheme, ports, unimplemented):
|
||||||
return "\n".join([
|
commands = ["backup-auth", "backup-deauth", "backup", "backup-set-encryption", "backup-unset-encryption", "backup-schedule", "backup-schedule-cat", "backup-unschedule",]
|
||||||
|
content = [
|
||||||
"### Backups",
|
"### Backups",
|
||||||
"",
|
"",
|
||||||
"Datastore backups are supported via AWS S3 and S3 compatible services like [minio](https://github.com/minio/minio).",
|
"Datastore backups are supported via AWS S3 and S3 compatible services like [minio](https://github.com/minio/minio).",
|
||||||
@@ -147,18 +148,12 @@ def usage_backup(service, alias, scheme, ports):
|
|||||||
"",
|
"",
|
||||||
"Backups can be performed using the backup commands:",
|
"Backups can be performed using the backup commands:",
|
||||||
"",
|
"",
|
||||||
command_help("backup-auth", service, alias, scheme, ports),
|
]
|
||||||
command_help("backup-deauth", service, alias, scheme, ports),
|
|
||||||
command_help("backup", service, alias, scheme, ports),
|
return fetch_commands_content(service, alias, scheme, ports, unimplemented, commands, content)
|
||||||
command_help("backup-set-encryption", service, alias, scheme, ports),
|
|
||||||
command_help("backup-unset-encryption", service, alias, scheme, ports),
|
|
||||||
command_help("backup-schedule", service, alias, scheme, ports),
|
|
||||||
command_help("backup-schedule-cat", service, alias, scheme, ports),
|
|
||||||
command_help("backup-unschedule", service, alias, scheme, ports),
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
def usage_docker_pull(service, alias, scheme, ports):
|
def usage_docker_pull(service, alias, scheme, ports, unimplemented):
|
||||||
service_prefix = service.upper()
|
service_prefix = service.upper()
|
||||||
return "\n".join([
|
return "\n".join([
|
||||||
"### Disabling `docker pull` calls",
|
"### Disabling `docker pull` calls",
|
||||||
@@ -169,6 +164,21 @@ def usage_docker_pull(service, alias, scheme, ports):
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
def fetch_commands_content(service, alias, scheme, ports, unimplemented, commands, content):
|
||||||
|
i = 0
|
||||||
|
for command in commands:
|
||||||
|
output = command_help(command, service, alias, scheme, ports, unimplemented)
|
||||||
|
if output == "":
|
||||||
|
continue
|
||||||
|
content.append(output)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
if i == 0:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
return "\n".join(content)
|
||||||
|
|
||||||
|
|
||||||
def parse_args(line):
|
def parse_args(line):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
arguments = []
|
arguments = []
|
||||||
@@ -195,7 +205,10 @@ def parse_args(line):
|
|||||||
return " ".join(arguments)
|
return " ".join(arguments)
|
||||||
|
|
||||||
|
|
||||||
def command_help(command, service, alias, scheme, ports):
|
def command_help(command, service, alias, scheme, ports, unimplemented):
|
||||||
|
if command in unimplemented:
|
||||||
|
return ""
|
||||||
|
|
||||||
data = command_data(command, service, alias, scheme, ports)
|
data = command_data(command, service, alias, scheme, ports)
|
||||||
content = [
|
content = [
|
||||||
f"### {data['description']}",
|
f"### {data['description']}",
|
||||||
@@ -221,12 +234,10 @@ def command_help(command, service, alias, scheme, ports):
|
|||||||
# content.append(f"- {flag}")
|
# content.append(f"- {flag}")
|
||||||
|
|
||||||
if len(data["examples"]) > 0:
|
if len(data["examples"]) > 0:
|
||||||
content.append("")
|
|
||||||
content.append("examples:")
|
|
||||||
content.append("")
|
content.append("")
|
||||||
content.append(data["examples"])
|
content.append(data["examples"])
|
||||||
|
|
||||||
return "\n".join(content)
|
return "\n" + "\n".join(content)
|
||||||
|
|
||||||
|
|
||||||
def command_data(command, service, alias, scheme, ports):
|
def command_data(command, service, alias, scheme, ports):
|
||||||
@@ -339,7 +350,7 @@ def command_data(command, service, alias, scheme, ports):
|
|||||||
|
|
||||||
def process_sentence(sentence_lines):
|
def process_sentence(sentence_lines):
|
||||||
sentence_lines = " ".join(sentence_lines)
|
sentence_lines = " ".join(sentence_lines)
|
||||||
sentences = ". ".join(i.strip().capitalize() for i in sentence_lines.split("."))
|
sentences = ". ".join(i.strip().capitalize() for i in sentence_lines.split(".")).strip()
|
||||||
if not sentences.endswith(".") and not sentences.endswith(":"):
|
if not sentences.endswith(".") and not sentences.endswith(":"):
|
||||||
sentences += ":"
|
sentences += ":"
|
||||||
return sentences
|
return sentences
|
||||||
@@ -359,21 +370,11 @@ def process_codeblock(codeblock_lines):
|
|||||||
return f"```\n{codeblock_lines}\n```"
|
return f"```\n{codeblock_lines}\n```"
|
||||||
|
|
||||||
|
|
||||||
def compile(service, version, alias, scheme, ports, dokku_version):
|
|
||||||
return "\n\n".join([
|
|
||||||
header(service),
|
|
||||||
description(service, version),
|
|
||||||
requirements(dokku_version),
|
|
||||||
installation(service, dokku_version),
|
|
||||||
commands(service, alias, scheme, ports),
|
|
||||||
usage(service, alias, scheme, ports),
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
service = None
|
service = None
|
||||||
version = None
|
version = None
|
||||||
alias = None
|
alias = None
|
||||||
|
unimplemented = []
|
||||||
with open("config") as f:
|
with open("config") as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
if "IMAGE_VERSION=${" in line:
|
if "IMAGE_VERSION=${" in line:
|
||||||
@@ -386,8 +387,12 @@ def main():
|
|||||||
scheme = re.search('"(.+)"', line).group(1)
|
scheme = re.search('"(.+)"', line).group(1)
|
||||||
if "PLUGIN_DATASTORE_PORTS=" in line:
|
if "PLUGIN_DATASTORE_PORTS=" in line:
|
||||||
ports = re.search('\((.+)\)', line).group(1).split(" ")
|
ports = re.search('\((.+)\)', line).group(1).split(" ")
|
||||||
|
if "PLUGIN_UNIMPLEMENTED_SUBCOMMANDS=" in line:
|
||||||
|
match = re.search('\((.+)\)', line)
|
||||||
|
if match is not None:
|
||||||
|
unimplemented = [s.strip('"') for s in match.group(1).split(" ")]
|
||||||
|
|
||||||
text = compile(service, version, alias, scheme, ports, "0.12.x+")
|
text = compile(service, version, alias, scheme, ports, unimplemented, "0.12.x+")
|
||||||
|
|
||||||
base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||||
readme_file = os.path.join(base_path, 'README.md')
|
readme_file = os.path.join(base_path, 'README.md')
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ service-info-cmd() {
|
|||||||
#F --service-root, show the service root directory
|
#F --service-root, show the service root directory
|
||||||
#F --status, show the service running status
|
#F --status, show the service running status
|
||||||
#F --version, show the service image version
|
#F --version, show the service image version
|
||||||
declare desc="print the connection information"
|
declare desc="print the service information"
|
||||||
local cmd="$PLUGIN_COMMAND_PREFIX:info" argv=("$@")
|
local cmd="$PLUGIN_COMMAND_PREFIX:info" argv=("$@")
|
||||||
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
declare SERVICE="$1" INFO_FLAG="$2"
|
declare SERVICE="$1" INFO_FLAG="$2"
|
||||||
|
|||||||
Reference in New Issue
Block a user