mirror of https://github.com/portainer/portainer
feat(test): update e2e setup
parent
c6e9d8e616
commit
36de0aee7b
|
@ -5,15 +5,62 @@ services:
|
||||||
container_name: e2e-portainer
|
container_name: e2e-portainer
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
networks:
|
||||||
|
- e2e-ci
|
||||||
|
|
||||||
cypress:
|
cypress:
|
||||||
image: cypress/included:3.5.0
|
image: cypress/included:3.5.0
|
||||||
container_name: e2e-cypress
|
container_name: e2e-cypress
|
||||||
|
# command: --record --browser chrome
|
||||||
depends_on:
|
depends_on:
|
||||||
- portainer
|
- portainer
|
||||||
working_dir: /e2e
|
working_dir: /e2e
|
||||||
environment:
|
environment:
|
||||||
- CYPRESS_baseUrl=http://e2e-portainer:9000
|
CYPRESS_baseUrl: http://e2e-portainer:9000
|
||||||
|
# CYPRESS_RECORD_KEY:
|
||||||
volumes:
|
volumes:
|
||||||
- ./cypress:/e2e/cypress
|
- ./cypress:/e2e/cypress
|
||||||
- ./cypress.json:/e2e/cypress.json
|
- ./cypress.json:/e2e/cypress.json
|
||||||
|
networks:
|
||||||
|
- e2e-ci
|
||||||
|
|
||||||
|
manager1:
|
||||||
|
image: docker:dind
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
DOCKER_TLS_CERTDIR:
|
||||||
|
hostname: manager1
|
||||||
|
networks:
|
||||||
|
- e2e-ci
|
||||||
|
depends_on:
|
||||||
|
- manager2
|
||||||
|
- worker1
|
||||||
|
- worker2
|
||||||
|
manager2:
|
||||||
|
image: docker:dind
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
DOCKER_TLS_CERTDIR:
|
||||||
|
hostname: manager2
|
||||||
|
networks:
|
||||||
|
- e2e-ci
|
||||||
|
worker1:
|
||||||
|
image: docker:dind
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
DOCKER_TLS_CERTDIR:
|
||||||
|
hostname: worker1
|
||||||
|
networks:
|
||||||
|
- e2e-ci
|
||||||
|
worker2:
|
||||||
|
image: docker:dind
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
DOCKER_TLS_CERTDIR:
|
||||||
|
hostname: worker2
|
||||||
|
networks:
|
||||||
|
- e2e-ci
|
||||||
|
|
||||||
|
networks:
|
||||||
|
e2e-ci:
|
||||||
|
driver: bridge
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
exec_in() { docker-compose exec -T $@; }
|
||||||
|
|
||||||
|
# Up all dinds nodes
|
||||||
|
docker-compose up -d manager1 manager2 worker1 worker2
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Up portainer
|
||||||
|
docker-compose up --exit-code-from cypress
|
Loading…
Reference in New Issue