mirror of https://github.com/docker/docs.git
parent
a17f182026
commit
f1b7b7be59
|
|
@ -99,7 +99,7 @@ function teardown() {
|
||||||
swarm_join "$DISCOVERY"
|
swarm_join "$DISCOVERY"
|
||||||
|
|
||||||
# Start a manager. It should keep retrying
|
# Start a manager. It should keep retrying
|
||||||
swarm_manage "$DISCOVERY"
|
swarm_manage_no_wait "$DISCOVERY"
|
||||||
|
|
||||||
# Now start the store
|
# Now start the store
|
||||||
start_store
|
start_store
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ function teardown() {
|
||||||
swarm_join "$DISCOVERY"
|
swarm_join "$DISCOVERY"
|
||||||
|
|
||||||
# Start a manager. It should keep retrying
|
# Start a manager. It should keep retrying
|
||||||
swarm_manage "$DISCOVERY"
|
swarm_manage_no_wait "$DISCOVERY"
|
||||||
|
|
||||||
# Now start the store
|
# Now start the store
|
||||||
start_store
|
start_store
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ function setup_discovery_file() {
|
||||||
start_docker 2
|
start_docker 2
|
||||||
|
|
||||||
# Start a manager. It should keep retrying
|
# Start a manager. It should keep retrying
|
||||||
swarm_manage "$DISCOVERY"
|
swarm_manage_no_wait "$DISCOVERY"
|
||||||
|
|
||||||
# Now create the discovery file.
|
# Now create the discovery file.
|
||||||
setup_discovery_file
|
setup_discovery_file
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ function teardown() {
|
||||||
swarm_join "$DISCOVERY"
|
swarm_join "$DISCOVERY"
|
||||||
|
|
||||||
# Start a manager. It should keep retrying
|
# Start a manager. It should keep retrying
|
||||||
swarm_manage "$DISCOVERY"
|
swarm_manage_no_wait "$DISCOVERY"
|
||||||
|
|
||||||
# Now start the store
|
# Now start the store
|
||||||
start_store
|
start_store
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,17 @@ function discovery_check_swarm_info() {
|
||||||
retry 10 1 eval "docker -H $host info | grep -q -e \"Nodes: $total\" -e \"Offers: $total\""
|
retry 10 1 eval "docker -H $host info | grep -q -e \"Nodes: $total\" -e \"Offers: $total\""
|
||||||
}
|
}
|
||||||
|
|
||||||
# Start the swarm manager in background.
|
|
||||||
function swarm_manage() {
|
function swarm_manage() {
|
||||||
|
local i=${#SWARM_MANAGE_PID[@]}
|
||||||
|
|
||||||
|
swarm_manage_no_wait "$@"
|
||||||
|
|
||||||
|
# Wait for nodes to be discovered
|
||||||
|
discovery_check_swarm_info "${#HOSTS[@]}" "${SWARM_HOSTS[$i]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Start the swarm manager in background.
|
||||||
|
function swarm_manage_no_wait() {
|
||||||
local discovery
|
local discovery
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
discovery=`join , ${HOSTS[@]}`
|
discovery=`join , ${HOSTS[@]}`
|
||||||
|
|
@ -114,9 +123,6 @@ function swarm_manage() {
|
||||||
|
|
||||||
# Wait for the Manager to be reachable
|
# Wait for the Manager to be reachable
|
||||||
wait_until_reachable "$host"
|
wait_until_reachable "$host"
|
||||||
|
|
||||||
# Wait for nodes to be discovered
|
|
||||||
discovery_check_swarm_info "${#HOSTS[@]}" "$host"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# swarm join every engine created with `start_docker`.
|
# swarm join every engine created with `start_docker`.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue