Update server subcommands
This commit is contained in:
parent
d37d8a0c66
commit
6cf7cf843a
10
abra
10
abra
@ -530,7 +530,11 @@ sub_cp() {
|
||||
###### Subcommand `context`
|
||||
|
||||
sub_server_init() {
|
||||
load_context
|
||||
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
|
||||
|
12
test.bats
12
test.bats
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user