From dd9444b03689d1a21b0cdd1b69d1d933d5f923a6 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Sun, 27 Sep 2020 13:26:27 +0200 Subject: [PATCH] Add `context init` command to set up remote swarm --- abra | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/abra b/abra index 44d8705..b78b0cd 100755 --- a/abra +++ b/abra @@ -375,11 +375,19 @@ sub_context_help() { echo "Usage: $PROGRAM_NAME [global opts] context [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"