From 0dca37d8a1a2a21ff42f789861fdcb5537f6cdc2 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 14:31:10 -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 | 26 ++++++++++++++++++++++---- pre-delete | 3 ++- subcommands/set | 40 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 87 insertions(+), 7 deletions(-) create mode 100755 subcommands/set diff --git a/README.md b/README.md index a363f6c..f7fc789 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ mongo:logs [-t|--tail] # print the most recent log mongo:pause # pause a running mongo service mongo:promote # promote service as MONGO_URL in mongo:restart # graceful shutdown and restart of the mongo service container +mongo:set # set or clear a property for a service mongo:start # start a previously stopped mongo service mongo:stop # stop a running mongo service mongo:unexpose # unexpose a previously exposed mongo service @@ -251,6 +252,25 @@ You can unlink a mongo service: dokku mongo:unlink lollipop playground ``` +### set or clear a property for a service + +```shell +# usage +dokku mongo:set +``` + +Set the network to attach after the service container is started: + +```shell +dokku mongo:set lollipop post-create-network custom-network +``` + +Unset the post-create-network value: + +```shell +dokku mongo: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 67e524b..3b6ae9d 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" @@ -81,21 +82,38 @@ 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=MONGO_INITDB_DATABASE=$DATABASE_NAME") + 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/data:/data/db") + [[ -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:/data/db" --env-file="$SERVICE_ROOT/ENV" --env "MONGO_INITDB_DATABASE=$DATABASE_NAME" -d --restart always --label dokku=service --label dokku.service=mongo "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" mongod $CONFIG_OPTIONS) + ID=$("$DOCKER_BIN" container run "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" mongod $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 47c5f8e44afcea42284b42fb9bb64405a8485753 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 3b6ae9d..ecf616f 100755 --- a/functions +++ b/functions @@ -94,6 +94,12 @@ service_create_container() { DOCKER_ARGS+=("--restart=always") DOCKER_ARGS+=("--volume=$SERVICE_HOST_ROOT/data:/data/db") + 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") @@ -110,6 +116,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 @@ -117,7 +125,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 echo "db.createUser({user:'admin',pwd:'$ROOTPASSWORD',roles:[{role:'userAdminAnyDatabase',db:'admin'},{role:'__system',db:'admin'},{role:'root',db:'admin'}]})" | "$DOCKER_BIN" container exec -i "$SERVICE_NAME" mongo admin >/dev/null echo "db.createUser({user:'$SERVICE',pwd:'$PASSWORD',roles:[{role:'readWrite',db:'$DATABASE_NAME'}]})" | "$DOCKER_BIN" container exec -i "$SERVICE_NAME" mongo -u admin -p "$ROOTPASSWORD" --authenticationDatabase admin "$DATABASE_NAME" >/dev/null From 31e4c43f98f89397716344350f627afbb0ade6b8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 7 Feb 2023 15:21:56 -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 90021e326ed143505fcc2da49ab19517b799164c 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 88bf4ac2cc326a1d062298e5f2de602dd665f290 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 ecf616f..47b35e0 100755 --- a/functions +++ b/functions @@ -82,9 +82,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=MONGO_INITDB_DATABASE=$DATABASE_NAME") DOCKER_ARGS+=("--hostname=$SERVICE") @@ -121,8 +122,8 @@ service_create_container() { fi # shellcheck disable=SC2086 - ID=$("$DOCKER_BIN" container run "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" mongod $CONFIG_OPTIONS) - echo "$ID" >"$SERVICE_ROOT/ID" + "$DOCKER_BIN" container create "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" mongod $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 d0c8f46f18322dc9310d29f719ee8cbdc0602550 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 47b35e0..310f2f4 100755 --- a/functions +++ b/functions @@ -123,7 +123,22 @@ service_create_container() { # shellcheck disable=SC2086 "$DOCKER_BIN" container create "${DOCKER_ARGS[@]}" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" mongod $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 4d79bc27bb7e24143bc512ea80566bbc6b32086d 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 310f2f4..eda7991 100755 --- a/functions +++ b/functions @@ -129,7 +129,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 @@ -137,7 +137,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 440c098bb361c6f801c14699ffae6bf2a757afe8 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 f7fc789..53f1687 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,12 @@ Set the network to attach after the service container is started: dokku mongo:set lollipop post-create-network custom-network ``` +Set multiple networks: + +```shell +dokku mongo: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 b7b6e071e143d5f802152cbdb73b320698614c5b 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 53f1687..00286a0 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,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 @@ -133,7 +136,10 @@ dokku mongo:info lollipop --dsn dokku mongo:info lollipop --exposed-ports dokku mongo:info lollipop --id dokku mongo:info lollipop --internal-ip +dokku mongo:info lollipop --initial-network dokku mongo:info lollipop --links +dokku mongo:info lollipop --post-create-network +dokku mongo:info lollipop --post-start-network dokku mongo:info lollipop --service-root dokku mongo:info lollipop --status dokku mongo: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