feat: add ability to skip restarts on link and unlink

Refs dokku/dokku-redis#192
This commit is contained in:
Jose Diaz-Gonzalez
2023-02-20 23:26:44 -05:00
parent 9fd0ede9f3
commit 3c6b6e1c0f
5 changed files with 30 additions and 9 deletions

View File

@@ -200,6 +200,7 @@ 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
- `-n|--no-restart "false"`: whether or not to restart the app on link (default: true)
A redis 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.
@@ -223,7 +224,7 @@ DOKKU_REDIS_LOLLIPOP_PORT_6379_TCP_ADDR=172.17.0.1
The following will be set on the linked application by default:
```
REDIS_URL=redis://:SOME_PASSWORD@dokku-redis-lollipop:6379
REDIS_URL=redis://lollipop:SOME_PASSWORD@dokku-redis-lollipop:6379/lollipop
```
The host exposed here only works internally in docker containers. If you want your container to be reachable from outside, you should use the `expose` subcommand. Another service can be linked to your app:
@@ -242,7 +243,13 @@ dokku redis:link lollipop playground
This will cause `REDIS_URL` to be set as:
```
redis2://:SOME_PASSWORD@dokku-redis-lollipop:6379
redis2://lollipop:SOME_PASSWORD@dokku-redis-lollipop:6379/lollipop
```
If you specify `REDIS_DATABASE_SCHEME` to equal `http`, we`ll also automatically adjust `REDIS_URL` to match the http interface:
```
http://lollipop:SOME_PASSWORD@dokku-redis-lollipop:${PLUGIN_DATASTORE_PORTS[1]}
```
### unlink the redis service from the app
@@ -252,6 +259,10 @@ redis2://:SOME_PASSWORD@dokku-redis-lollipop:6379
dokku redis:unlink <service> <app>
```
flags:
- `-n|--no-restart "false"`: whether or not to restart the app on unlink (default: true)
You can unlink a redis service:
> NOTE: this will restart your app and unset related environment variables
@@ -453,7 +464,7 @@ flags:
- `-I|--image-version IMAGE_VERSION`: the image version to start the service with
- `-N|--initial-network INITIAL_NETWORK`: the initial network to attach the service to
- `-P|--post-create-network NETWORKS`: a comman-separated list of networks to attach the service container to after service creation
- `-R|--restart-apps "true"`: whether to force an app restart
- `-R|--restart-apps "true"`: whether or not to force an app restart (default: false)
- `-S|--post-start-network NETWORKS`: a comman-separated list of networks to attach the service container to after service start
- `-s|--shm-size SHM_SIZE`: override shared memory size for redis docker container