You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/test/e2e/docker-swarm-cluster.sh

24 lines
654 B

#!/bin/sh
exec_in() { docker-compose exec -T $@; }
# Up all dinds nodes
docker-compose up -d
# Manager1 init
exec_in manager1 docker swarm init
TOKEN_WORKER="$(exec_in manager1 docker swarm join-token -q worker)"
TOKEN_MANAGER="$(exec_in manager1 docker swarm join-token -q manager)"
# Manager2 join
exec_in manager2 docker swarm join --token $TOKEN_MANAGER manager1:2377
# Worker1 join
exec_in worker1 docker swarm join --token $TOKEN_WORKER manager1:2377
# Worker2 join
exec_in worker2 docker swarm join --token $TOKEN_WORKER manager1:2377
# Deploy agent within dind swarm
exec_in manager1 docker stack deploy -c agent-stack.yml portainer-agent