Rename abra context to abra server

This commit is contained in:
3wc 2020-10-23 05:02:39 +02:00
parent b7757b51b1
commit 16a09887e6

24
abra
View File

@ -165,7 +165,7 @@ sub_help() {
echo " --version Show program version"
echo ""
echo "Commands:"
echo " context manage remote swarm contexts"
echo " server manage remote host"
echo " cp copy files to a container"
echo " deploy let 'em rip"
echo " logs tail logs from a deployed service"
@ -391,23 +391,24 @@ sub_cp() {
###### Subcommand `context`
sub_context_help() {
echo "Usage: $PROGRAM_NAME [global opts] context <subcommand> [sub opts]"
sub_server_help() {
echo "Usage: $PROGRAM_NAME [global opts] server <subcommand> [sub opts]"
echo ""
echo "Subcommands:"
echo " create HOST [USER] [PORT] set up remote Docker context"
echo " add HOST [USER] [PORT] set up remote Docker context"
echo " rm HOST"
echo " use HOST activate remote Docker context"
echo " init HOST activate swarm mode"
}
sub_context_init() {
sub_server_init() {
load_context
docker swarm init || true
docker network create --driver=overlay proxy --scope swarm || true
}
sub_context_create() {
sub_server_add() {
HOST="$1"
USERNAME="$2"
PORT="$3"
@ -424,15 +425,20 @@ sub_context_create() {
--docker "host=ssh://$USERNAME$HOST$PORT"
}
sub_context_use() {
sub_server_rm() {
HOST="$1"
docker context rm "$HOST"
}
sub_server_use() {
docker context use "$1"
}
sub_context() {
sub_server() {
SUBCOMMAND2=$1
shift
# shellcheck disable=SC2068
parse_subcommand "$SUBCOMMAND2" "context" $@
parse_subcommand "$SUBCOMMAND2" "server" $@
}