Add some output

This commit is contained in:
Patrick Jentsch 2019-11-27 09:43:34 +01:00
parent d63b5ec266
commit 3bc485cdb3

View File

@ -8,8 +8,10 @@ if [ -z ${SWARM_MANAGER_IP} ]; then
SWARM_MANAGER_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') SWARM_MANAGER_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
fi fi
echo "Leave possible swarm..." echo "Leave possible swarm and down all services..."
docker swarm leave --force > /dev/null 2>&1 docker swarm leave --force > /dev/null 2>&1
docker-compose --file dind_swarm.yml down > /dev/null 2>&1
echo "Start storage container" echo "Start storage container"
docker-compose --file dind_swarm.yml up --detach storage docker-compose --file dind_swarm.yml up --detach storage
@ -26,8 +28,9 @@ sleep 5
echo "Init Docker swarm..." echo "Init Docker swarm..."
docker swarm init --advertise-addr ${SWARM_MANAGER_IP} > /dev/null 2>&1 docker swarm init --advertise-addr ${SWARM_MANAGER_IP} > /dev/null 2>&1
echo "Join workers to swarm..." echo "Add workers to swarm..."
SWARM_WORKER_TOKEN=$(docker swarm join-token -q worker) SWARM_WORKER_TOKEN=$(docker swarm join-token -q worker)
for i in $(seq 1 ${SWARM_WORKER_NUMBER}); do for i in $(seq 1 ${SWARM_WORKER_NUMBER}); do
echo "[opaque_worker_${i}]"
docker-compose --file dind_swarm.yml exec --index=${i} worker docker swarm join --token ${SWARM_WORKER_TOKEN} ${SWARM_MANAGER_IP}:2377 docker-compose --file dind_swarm.yml exec --index=${i} worker docker swarm join --token ${SWARM_WORKER_TOKEN} ${SWARM_MANAGER_IP}:2377
done done