feat: implement first-pass at networking plugin

Implements help, `rebuild`, and `rebuildall` command.

Refs #2403
This commit is contained in:
Jose Diaz-Gonzalez
2017-04-21 01:51:32 -06:00
committed by Michael Hobbs
parent 8be92d9739
commit ec9b8be5f8
8 changed files with 242 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
network_help_content_func() {
declare desc="return network plugin help content"
cat<<help_content
network:rebuild <app>, Rebuilds network settings for an app
network:rebuildall, Rebuild network settings for all apps
help_content
}
network_help_cmd() {
if [[ $1 = "network:help" ]] ; then
echo -e 'Usage: dokku network[:COMMAND]'
echo ''
echo 'Rebuilds network settings for an app.'
echo ''
echo 'Additional commands:'
network_help_content_func | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
network_help_content_func
else
cat<<help_desc
network, Manage network configuration for applications
help_desc
fi
}