From a3a2183ec8e0c13ea42c3ca7062d1e64918f2972 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 14:31:11 -0500 Subject: [PATCH 1/9] feat: add support for specifying an initial-network property This network is the network that is associated with the container on creation. If specified, then the bridge network is not attached to the service. Only a single initial network can be specified at this time. --- README.md | 20 ++++++++++++++++++++ bin/generate | 2 +- commands | 3 ++- functions | 30 ++++++++++++++++++++++++++---- pre-delete | 3 ++- subcommands/set | 40 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 7 deletions(-) create mode 100755 subcommands/set diff --git a/README.md b/README.md index 2846dc1..d37746e 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ mysql:logs [-t|--tail] # print the most recent log mysql:pause # pause a running mysql service mysql:promote # promote service as DATABASE_URL in mysql:restart # graceful shutdown and restart of the mysql service container +mysql:set # set or clear a property for a service mysql:start # start a previously stopped mysql service mysql:stop # stop a running mysql service mysql:unexpose # unexpose a previously exposed mysql service @@ -250,6 +251,25 @@ You can unlink a mysql service: dokku mysql:unlink lollipop playground ``` +### set or clear a property for a service + +```shell +# usage +dokku mysql:set +``` + +Set the network to attach after the service container is started: + +```shell +dokku mysql:set lollipop post-create-network custom-network +``` + +Unset the post-create-network value: + +```shell +dokku mysql:set lollipop post-create-network +``` + ### Service Lifecycle The lifecycle of each service can be managed through the following commands: diff --git a/bin/generate b/bin/generate index c5aa616..89b9999 100755 --- a/bin/generate +++ b/bin/generate @@ -131,7 +131,7 @@ def usage_section(service, variable, alias, image, scheme, ports, options, unimp def usage_intro(service, variable, alias, image, scheme, ports, options, unimplemented): - commands = ["create", "info", "list", "logs", "link", "unlink"] + commands = ["create", "info", "list", "logs", "link", "unlink", "set"] content = ["### Basic Usage"] return fetch_commands_content( diff --git a/commands b/commands index 2fb4cda..5a878fe 100755 --- a/commands +++ b/commands @@ -1,7 +1,8 @@ #!/usr/bin/env bash source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" [[ " help $PLUGIN_COMMAND_PREFIX:help $PLUGIN_COMMAND_PREFIX $PLUGIN_COMMAND_PREFIX:default " == *" $1 "* ]] || [[ "$1" == "$PLUGIN_COMMAND_PREFIX:"* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" -source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_BASE_PATH/common/functions" + set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/functions b/functions index 6fb8567..1e89b97 100755 --- a/functions +++ b/functions @@ -3,7 +3,8 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common-functions" -source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_BASE_PATH/common/functions" +source "$PLUGIN_BASE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" if [[ -f "$PLUGIN_AVAILABLE_PATH/docker-options/functions" ]]; then source "$PLUGIN_AVAILABLE_PATH/docker-options/functions" @@ -84,21 +85,42 @@ service_create_container() { export CONFIG_OPTIONS="$(cat "$SERVICE_ROOT/CONFIG_OPTIONS")" fi + declare -a DOCKER_ARGS + DOCKER_ARGS=() + DOCKER_ARGS+=("--detach") + DOCKER_ARGS+=("--env-file=$SERVICE_ROOT/ENV") + DOCKER_ARGS+=("--env=MYSQL_DATABASE=$DATABASE_NAME") + DOCKER_ARGS+=("--env=MYSQL_PASSWORD=$PASSWORD") + DOCKER_ARGS+=("--env=MYSQL_ROOT_PASSWORD=$ROOTPASSWORD") + DOCKER_ARGS+=("--env=MYSQL_USER=mysql") + DOCKER_ARGS+=("--hostname=$SERVICE") + DOCKER_ARGS+=("--label=dokku.service=$PLUGIN_COMMAND_PREFIX") + DOCKER_ARGS+=("--label=dokku=service") + DOCKER_ARGS+=("--name=$SERVICE_NAME") + DOCKER_ARGS+=("--restart=always") + DOCKER_ARGS+=("--volume=$SERVICE_HOST_ROOT/$PLUGIN_CONFIG_SUFFIX:/etc/mysql/conf.d") + DOCKER_ARGS+=("--volume=$SERVICE_HOST_ROOT/data:/var/lib/mysql") + [[ -f "$SERVICE_ROOT/SERVICE_MEMORY" ]] && SERVICE_MEMORY="$(cat "$SERVICE_ROOT/SERVICE_MEMORY")" if [[ -n "$SERVICE_MEMORY" ]]; then - MEMORY_LIMIT="--memory=${SERVICE_MEMORY}m" + DOCKER_ARGS+=("--memory=${SERVICE_MEMORY}m") fi [[ -f "$SERVICE_ROOT/SHM_SIZE" ]] && SERVICE_SHM_SIZE="$(cat "$SERVICE_ROOT/SHM_SIZE")" if [[ -n "$SERVICE_SHM_SIZE" ]]; then - SHM_SIZE="--shm-size=${SERVICE_SHM_SIZE}" + DOCKER_ARGS+=("--shm-size=${SERVICE_SHM_SIZE}") fi [[ -f "$SERVICE_ROOT/IMAGE" ]] && PLUGIN_IMAGE="$(cat "$SERVICE_ROOT/IMAGE")" [[ -f "$SERVICE_ROOT/IMAGE_VERSION" ]] && PLUGIN_IMAGE_VERSION="$(cat "$SERVICE_ROOT/IMAGE_VERSION")" + local network="$(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "initial-network")" + if [[ -n "$network" ]]; then + DOCKER_ARGS+=("--network=${network}") + fi + # shellcheck disable=SC2086 - ID=$("$DOCKER_BIN" container run --name "$SERVICE_NAME" $MEMORY_LIMIT $SHM_SIZE -v "$SERVICE_HOST_ROOT/data:/var/lib/mysql" -v "$SERVICE_HOST_ROOT/$PLUGIN_CONFIG_SUFFIX:/etc/mysql/conf.d" -e "MYSQL_ROOT_PASSWORD=$ROOTPASSWORD" -e MYSQL_USER=mysql -e "MYSQL_PASSWORD=$PASSWORD" -e "MYSQL_DATABASE=$DATABASE_NAME" --env-file="$SERVICE_ROOT/ENV" -d --restart always --label dokku=service --label dokku.service=mysql "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" $CONFIG_OPTIONS) + ID=$("$DOCKER_BIN" container run "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" $CONFIG_OPTIONS) echo "$ID" >"$SERVICE_ROOT/ID" dokku_log_verbose_quiet "Waiting for container to be ready" diff --git a/pre-delete b/pre-delete index d315464..1f565d5 100755 --- a/pre-delete +++ b/pre-delete @@ -1,5 +1,6 @@ #!/usr/bin/env bash -source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_BASE_PATH/common/functions" + source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions" set -eo pipefail diff --git a/subcommands/set b/subcommands/set new file mode 100755 index 0000000..823497b --- /dev/null +++ b/subcommands/set @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config" +set -eo pipefail +[[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_BASE_PATH/common/functions" +source "$PLUGIN_BASE_PATH/common/property-functions" + +service-set-cmd() { + #E set the network to attach after the service container is started + #E dokku $PLUGIN_COMMAND_PREFIX:set lollipop post-create-network custom-network + #E unset the post-create-network value + #E dokku $PLUGIN_COMMAND_PREFIX:set lollipop post-create-network + #A service, service to run command against + #A key, property name to set + #A value, optional property value to set or empty to unset key + declare desc="set or clear a property for a service" + local cmd="$PLUGIN_COMMAND_PREFIX:set" argv=("$@") + [[ ${argv[0]} == "$cmd" ]] && shift 1 + declare SERVICE="$1" KEY="$2" VALUE="$3" + local VALID_KEYS=("post-create-network" "post-start-network" "initial-network") + verify_service_name "$SERVICE" + + [[ -z "$KEY" ]] && dokku_log_fail "No key specified" + + if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then + dokku_log_fail "Invalid key specified, valid keys include: network" + fi + + if [[ -n "$VALUE" ]]; then + dokku_log_info2_quiet "Setting ${KEY} to ${VALUE}" + fn-plugin-property-write "PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" "$VALUE" + else + dokku_log_info2_quiet "Unsetting ${KEY}" + if [[ "$KEY" == "rev-env-var" ]]; then + fn-plugin-property-write "PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" "$VALUE" + else + fn-plugin-property-delete "PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" + fi + fi +} From 53927c93dbf6d4394cabe137c59851e9d2163a84 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 15:21:28 -0500 Subject: [PATCH 2/9] fix: correct issue with checking if the service container is ready when using an initial-network --- functions | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/functions b/functions index 1e89b97..cc3710a 100755 --- a/functions +++ b/functions @@ -101,6 +101,12 @@ service_create_container() { DOCKER_ARGS+=("--volume=$SERVICE_HOST_ROOT/$PLUGIN_CONFIG_SUFFIX:/etc/mysql/conf.d") DOCKER_ARGS+=("--volume=$SERVICE_HOST_ROOT/data:/var/lib/mysql") + declare -a LINK_CONTAINER_DOCKER_ARGS + LINK_CONTAINER_DOCKER_ARGS=() + LINK_CONTAINER_DOCKER_ARGS+=("--rm") + LINK_CONTAINER_DOCKER_ARGS+=("--link") + LINK_CONTAINER_DOCKER_ARGS+=("$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX") + [[ -f "$SERVICE_ROOT/SERVICE_MEMORY" ]] && SERVICE_MEMORY="$(cat "$SERVICE_ROOT/SERVICE_MEMORY")" if [[ -n "$SERVICE_MEMORY" ]]; then DOCKER_ARGS+=("--memory=${SERVICE_MEMORY}m") @@ -117,6 +123,8 @@ service_create_container() { local network="$(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "initial-network")" if [[ -n "$network" ]]; then DOCKER_ARGS+=("--network=${network}") + DOCKER_ARGS+=("--network-alias=$SERVICE_NAME") + LINK_CONTAINER_DOCKER_ARGS+=("--network=${network}") fi # shellcheck disable=SC2086 @@ -124,7 +132,7 @@ service_create_container() { echo "$ID" >"$SERVICE_ROOT/ID" dokku_log_verbose_quiet "Waiting for container to be ready" - "$DOCKER_BIN" container run --rm --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" "$PLUGIN_WAIT_IMAGE" -p "$PLUGIN_DATASTORE_WAIT_PORT" >/dev/null + "$DOCKER_BIN" container run "${LINK_CONTAINER_DOCKER_ARGS[@]}" "$PLUGIN_WAIT_IMAGE" -c "$SERVICE_NAME:$PLUGIN_DATASTORE_WAIT_PORT" >/dev/null dokku_log_info2 "$PLUGIN_SERVICE container created: $SERVICE" service_info "$SERVICE" From 8ca3b8f9888f99e59a2d7433d3d89da5809605ad Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 15:21:57 -0500 Subject: [PATCH 3/9] fix: actually call the :set function and ensure we write properties to the correct namespace --- subcommands/set | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/subcommands/set b/subcommands/set index 823497b..8c82b1e 100755 --- a/subcommands/set +++ b/subcommands/set @@ -4,6 +4,7 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_BASE_PATH/common/functions" source "$PLUGIN_BASE_PATH/common/property-functions" +source "$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)/common-functions" service-set-cmd() { #E set the network to attach after the service container is started @@ -28,13 +29,15 @@ service-set-cmd() { if [[ -n "$VALUE" ]]; then dokku_log_info2_quiet "Setting ${KEY} to ${VALUE}" - fn-plugin-property-write "PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" "$VALUE" + fn-plugin-property-write "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" "$VALUE" else dokku_log_info2_quiet "Unsetting ${KEY}" if [[ "$KEY" == "rev-env-var" ]]; then - fn-plugin-property-write "PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" "$VALUE" + fn-plugin-property-write "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" "$VALUE" else - fn-plugin-property-delete "PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" + fn-plugin-property-delete "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "$KEY" fi fi } + +service-set-cmd "$@" From c5d2a6804cc6f3cf6e6d9e0f136fa7a69ba03c2c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 15:54:13 -0500 Subject: [PATCH 4/9] fix: correct error message for valid/invalid properties --- subcommands/set | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subcommands/set b/subcommands/set index 8c82b1e..656bbb1 100755 --- a/subcommands/set +++ b/subcommands/set @@ -18,13 +18,13 @@ service-set-cmd() { local cmd="$PLUGIN_COMMAND_PREFIX:set" argv=("$@") [[ ${argv[0]} == "$cmd" ]] && shift 1 declare SERVICE="$1" KEY="$2" VALUE="$3" - local VALID_KEYS=("post-create-network" "post-start-network" "initial-network") + local VALID_KEYS=("initial-network" "post-create-network" "post-start-network") verify_service_name "$SERVICE" [[ -z "$KEY" ]] && dokku_log_fail "No key specified" if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then - dokku_log_fail "Invalid key specified, valid keys include: network" + dokku_log_fail "Invalid key specified, valid keys include: initial-network, post-create-network, post-start-network" fi if [[ -n "$VALUE" ]]; then From 3f40d5476d6ac9ddc8a5fcef37582f81741e87a0 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 15:54:39 -0500 Subject: [PATCH 5/9] refactor: directly write out the cid file when creating the service container --- functions | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/functions b/functions index cc3710a..f106712 100755 --- a/functions +++ b/functions @@ -85,9 +85,10 @@ service_create_container() { export CONFIG_OPTIONS="$(cat "$SERVICE_ROOT/CONFIG_OPTIONS")" fi + rm -f "$SERVICE_ROOT/ID" declare -a DOCKER_ARGS DOCKER_ARGS=() - DOCKER_ARGS+=("--detach") + DOCKER_ARGS+=("--cidfile=$SERVICE_ROOT/ID") DOCKER_ARGS+=("--env-file=$SERVICE_ROOT/ENV") DOCKER_ARGS+=("--env=MYSQL_DATABASE=$DATABASE_NAME") DOCKER_ARGS+=("--env=MYSQL_PASSWORD=$PASSWORD") @@ -128,8 +129,8 @@ service_create_container() { fi # shellcheck disable=SC2086 - ID=$("$DOCKER_BIN" container run "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" $CONFIG_OPTIONS) - echo "$ID" >"$SERVICE_ROOT/ID" + "$DOCKER_BIN" container create "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" $CONFIG_OPTIONS >/dev/null + "$DOCKER_BIN" container start "$(cat "$SERVICE_ROOT/ID")" >/dev/null dokku_log_verbose_quiet "Waiting for container to be ready" "$DOCKER_BIN" container run "${LINK_CONTAINER_DOCKER_ARGS[@]}" "$PLUGIN_WAIT_IMAGE" -c "$SERVICE_NAME:$PLUGIN_DATASTORE_WAIT_PORT" >/dev/null From c12c33d1ce0ba6ab8fbb46da310a4d3703b324ac Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 15:59:15 -0500 Subject: [PATCH 6/9] feat: add support for attaching to networks after service container creation and start --- functions | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/functions b/functions index f106712..e211598 100755 --- a/functions +++ b/functions @@ -130,7 +130,22 @@ service_create_container() { # shellcheck disable=SC2086 "$DOCKER_BIN" container create "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" $CONFIG_OPTIONS >/dev/null + + if [[ -n "$(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-create-network")" ]]; then + dokku_log_verbose_quiet "Connecting to networks after container create" + while read -r line || [[ -n "$line" ]]; do + dokku_log_verbose_quiet "- $line" + "$DOCKER_BIN" network connect --alias "$SERVICE_NAME" "$line" "$SERVICE_NAME" + done < <(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-create-network") + fi "$DOCKER_BIN" container start "$(cat "$SERVICE_ROOT/ID")" >/dev/null + if [[ -n "$(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-start-network")" ]]; then + dokku_log_verbose_quiet "Connecting to networks after container start" + while read -r line || [[ -n "$line" ]]; do + dokku_log_verbose_quiet "- $line" + "$DOCKER_BIN" network connect --alias "$SERVICE_NAME" "$line" "$SERVICE_NAME" + done < <(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-start-network") + fi dokku_log_verbose_quiet "Waiting for container to be ready" "$DOCKER_BIN" container run "${LINK_CONTAINER_DOCKER_ARGS[@]}" "$PLUGIN_WAIT_IMAGE" -c "$SERVICE_NAME:$PLUGIN_DATASTORE_WAIT_PORT" >/dev/null From 6e318813bc4a4e5941f867b9190f04e1f31bb748 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 16:07:53 -0500 Subject: [PATCH 7/9] feat: add ability to set multiple, comma-delimited post-create and post-start networks --- functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions b/functions index e211598..3ec59e6 100755 --- a/functions +++ b/functions @@ -136,7 +136,7 @@ service_create_container() { while read -r line || [[ -n "$line" ]]; do dokku_log_verbose_quiet "- $line" "$DOCKER_BIN" network connect --alias "$SERVICE_NAME" "$line" "$SERVICE_NAME" - done < <(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-create-network") + done < <(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-create-network" | tr "," "\n") fi "$DOCKER_BIN" container start "$(cat "$SERVICE_ROOT/ID")" >/dev/null if [[ -n "$(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-start-network")" ]]; then @@ -144,7 +144,7 @@ service_create_container() { while read -r line || [[ -n "$line" ]]; do dokku_log_verbose_quiet "- $line" "$DOCKER_BIN" network connect --alias "$SERVICE_NAME" "$line" "$SERVICE_NAME" - done < <(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-start-network") + done < <(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-start-network" | tr "," "\n") fi dokku_log_verbose_quiet "Waiting for container to be ready" From 58948380b2d9f119674e76c2784d695a5e04fbea Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 16:09:41 -0500 Subject: [PATCH 8/9] docs: add example for multiple networks --- README.md | 6 ++++++ subcommands/set | 2 ++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index d37746e..75c7336 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,12 @@ Set the network to attach after the service container is started: dokku mysql:set lollipop post-create-network custom-network ``` +Set multiple networks: + +```shell +dokku mysql:set lollipop post-create-network custom-network,other-network +``` + Unset the post-create-network value: ```shell diff --git a/subcommands/set b/subcommands/set index 656bbb1..260c918 100755 --- a/subcommands/set +++ b/subcommands/set @@ -9,6 +9,8 @@ source "$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)/common-functi service-set-cmd() { #E set the network to attach after the service container is started #E dokku $PLUGIN_COMMAND_PREFIX:set lollipop post-create-network custom-network + #E set multiple networks + #E dokku $PLUGIN_COMMAND_PREFIX:set lollipop post-create-network custom-network,other-network #E unset the post-create-network value #E dokku $PLUGIN_COMMAND_PREFIX:set lollipop post-create-network #A service, service to run command against From 93cb96f11a57995b926a5fd451fab4a633846c24 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 16:13:58 -0500 Subject: [PATCH 9/9] feat: add network properties to :info output --- README.md | 6 ++++++ common-functions | 3 +++ subcommands/info | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 75c7336..1562b11 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,10 @@ flags: - `--exposed-ports`: show service exposed ports - `--id`: show the service container id - `--internal-ip`: show the service internal ip +- `--initial-network`: show the initial network being connected to - `--links`: show the service app links +- `--post-create-network`: show the networks to attach to after service container creation +- `--post-start-network`: show the networks to attach to after service container start - `--service-root`: show the service root directory - `--status`: show the service running status - `--version`: show the service image version @@ -132,7 +135,10 @@ dokku mysql:info lollipop --dsn dokku mysql:info lollipop --exposed-ports dokku mysql:info lollipop --id dokku mysql:info lollipop --internal-ip +dokku mysql:info lollipop --initial-network dokku mysql:info lollipop --links +dokku mysql:info lollipop --post-create-network +dokku mysql:info lollipop --post-start-network dokku mysql:info lollipop --service-root dokku mysql:info lollipop --status dokku mysql:info lollipop --version diff --git a/common-functions b/common-functions index 2b277a6..b8f6c76 100755 --- a/common-functions +++ b/common-functions @@ -539,7 +539,10 @@ service_info() { "--exposed-ports: $(service_exposed_ports "$SERVICE")" "--id: ${SERVICE_CONTAINER_ID}" "--internal-ip: $(get_container_ip "${SERVICE_CONTAINER_ID}")" + "--initial-network: $(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "initial-network")" "--links: $(service_linked_apps "$SERVICE")" + "--post-create-network: $(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-create-network")" + "--post-start-network: $(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-start-network")" "--service-root: ${SERVICE_ROOT}" "--status: $(service_status "$SERVICE")" "--version: $(service_version "$SERVICE")" diff --git a/subcommands/info b/subcommands/info index 7f4b7aa..9cba535 100755 --- a/subcommands/info +++ b/subcommands/info @@ -15,7 +15,10 @@ service-info-cmd() { #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --exposed-ports #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --id #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --internal-ip + #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --initial-network #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --links + #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --post-create-network + #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --post-start-network #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --service-root #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --status #E dokku $PLUGIN_COMMAND_PREFIX:info lollipop --version @@ -26,7 +29,10 @@ service-info-cmd() { #F --exposed-ports, show service exposed ports #F --id, show the service container id #F --internal-ip, show the service internal ip + #F --initial-network, show the initial network being connected to #F --links, show the service app links + #F --post-create-network, show the networks to attach to after service container creation + #F --post-start-network, show the networks to attach to after service container start #F --service-root, show the service root directory #F --status, show the service running status #F --version, show the service image version