rename admin command
This commit is contained in:
@@ -17,9 +17,9 @@ dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo
|
|||||||
## commands
|
## commands
|
||||||
|
|
||||||
```
|
```
|
||||||
mongo:admin <name> Connect via telnet to a mongo service as admin user
|
|
||||||
mongo:clone <name> <new-name> Create container <new-name> then copy data from <name> into <new-name>
|
mongo:clone <name> <new-name> Create container <new-name> then copy data from <name> into <new-name>
|
||||||
mongo:connect <name> Connect via telnet to a mongo service
|
mongo:connect <name> Connect via telnet to a mongo service
|
||||||
|
mongo:connect-admin <name> Connect via telnet to a mongo service as admin user
|
||||||
mongo:create <name> Create a mongo service with environment variables
|
mongo:create <name> Create a mongo service with environment variables
|
||||||
mongo:destroy <name> Delete the service and stop its container if there are no links left
|
mongo:destroy <name> Delete the service and stop its container if there are no links left
|
||||||
mongo:export <name> > <file> Export a dump of the mongo service database
|
mongo:export <name> > <file> Export a dump of the mongo service database
|
||||||
|
|||||||
4
commands
4
commands
@@ -19,8 +19,8 @@ case "$1" in
|
|||||||
"$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/subcommands/connect" "$@"
|
"$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/subcommands/connect" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
$PLUGIN_COMMAND_PREFIX:admin)
|
$PLUGIN_COMMAND_PREFIX:connect-admin)
|
||||||
"$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/subcommands/admin" "$@"
|
"$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/subcommands/connect-admin" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
$PLUGIN_COMMAND_PREFIX:create)
|
$PLUGIN_COMMAND_PREFIX:create)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
source "$PLUGIN_BASE_PATH/common/functions"
|
source "$PLUGIN_BASE_PATH/common/functions"
|
||||||
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
|
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
|
||||||
|
|
||||||
mongo-admin-cmd() {
|
mongo-connect-admin-cmd() {
|
||||||
declare desc="connect via mongo to a $PLUGIN_SERVICE service as admin user"
|
declare desc="connect via mongo to a $PLUGIN_SERVICE service as admin user"
|
||||||
local cmd="$PLUGIN_COMMAND_PREFIX:admin" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
local cmd="$PLUGIN_COMMAND_PREFIX:admin" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||||
declare SERVICE="$1"
|
declare SERVICE="$1"
|
||||||
@@ -19,4 +19,4 @@ mongo-admin-cmd() {
|
|||||||
docker exec -i $SERVICE_TTY_OPTS "$SERVICE_NAME" mongo -u admin -p "$PASSWORD" --authenticationDatabase admin "$SERVICE"
|
docker exec -i $SERVICE_TTY_OPTS "$SERVICE_NAME" mongo -u admin -p "$PASSWORD" --authenticationDatabase admin "$SERVICE"
|
||||||
}
|
}
|
||||||
|
|
||||||
mongo-admin-cmd "$@"
|
mongo-connect-admin-cmd "$@"
|
||||||
Reference in New Issue
Block a user