Update server subcommands

This commit is contained in:
3wc 2020-10-26 11:58:15 +02:00
parent d37d8a0c66
commit 6cf7cf843a
2 changed files with 15 additions and 7 deletions

8
abra
View File

@ -530,7 +530,11 @@ sub_cp() {
###### Subcommand `context`
sub_server_init() {
export DOCKER_CONTEXT="$1"
if [ -n "$DOCKER_CONTEXT" ]; then
load_context
fi
docker swarm init || true
docker network create --driver=overlay proxy --scope swarm || true
@ -562,6 +566,10 @@ sub_server_use() {
docker context use "$1"
}
sub_server_ls() {
docker context ls
}
sub_server() {
SUBCOMMAND2=$1
shift

View File

@ -8,9 +8,9 @@
./abra --help
}
# TODO(decentral1se): re-enable when abra works again
# @test "abra server add/rm works" {
# ./abra server add swarm.example.com user 222
# docker context ls | grep swarm.example.com
# ./abra server rm swarm.example.com
# }
@test "abra server add/rm works" {
./abra server add swarm.example.com
docker context ls | grep swarm.example.com
./abra server rm swarm.example.com
./abra server add swarm-test.autonomic.zone calix 222
}