Add `context init` command to set up remote swarm
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2020-09-27 13:26:27 +02:00
parent 81e24b6f72
commit dd9444b036
1 changed files with 10 additions and 2 deletions

12
abra
View File

@ -375,11 +375,19 @@ sub_context_help() {
echo "Usage: $PROGRAM_NAME [global opts] context <subcommand> [sub opts]"
echo ""
echo "Subcommands:"
echo " init HOST [USER] [PORT] set up remote Docker context"
echo " use activate remote Docker context"
echo " create HOST [USER] [PORT] set up remote Docker context"
echo " use HOST activate remote Docker context"
echo " init HOST activate swarm mode"
}
sub_context_init() {
load_context
docker swarm init || true
docker network create --driver=overlay proxy --scope swarm || true
}
sub_context_create() {
HOST="$1"
USERNAME="$2"
PORT="$3"