diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 81ba9c6..90bc11c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,10 +16,10 @@ test: services: - docker:dind script: - - docker-compose -f docker-compose.ci.yml --env-file ci/.env.ci up -d + - docker-compose -f docker-compose.ci-1.yml --env-file ci/.env.ci up -d - sh ci/wait-up.sh - - sleep 30 - - docker-compose -f docker-compose.ci.yml --env-file ci/.env.ci logs + - docker-compose -f docker-compose.ci-1.yml --env-file ci/.env.ci logs + - docker-compose -f docker-compose.ci-2.yml --env-file ci/.env.ci up -d - docker exec -t v3-territory sh -c "npm run test:integration:ci" coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ rules: diff --git a/ci/wait-up.sh b/ci/wait-up.sh index 4308dfa..1873d72 100644 --- a/ci/wait-up.sh +++ b/ci/wait-up.sh @@ -1,6 +1,6 @@ #!/bin/bash testlog() { - docker logs v3-territory-db-test | grep -q "database system is ready to accept connections" + docker logs v3-territory-db-test | grep -q "listening on IPv6 address "::", port 5432" } testlog 2> /dev/null diff --git a/docker-compose.ci.yml b/docker-compose.ci-1.yml similarity index 71% rename from docker-compose.ci.yml rename to docker-compose.ci-1.yml index cd9a1d2..4a33291 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci-1.yml @@ -1,22 +1,6 @@ version: '3.8' services: - api: - container_name: v3-territory - build: - dockerfile: ci/Dockerfile - context: . - env_file: - - ci/.env.ci - ports: - - 5004:5004 - depends_on: - - db - - broker - - redis - networks: - - v3-network - redis: container_name: v3-territory-redis image: ${REDIS_IMAGE} diff --git a/docker-compose.ci-2.yml b/docker-compose.ci-2.yml new file mode 100644 index 0000000..2e4fc8d --- /dev/null +++ b/docker-compose.ci-2.yml @@ -0,0 +1,19 @@ +version: '3.8' + +services: + api: + container_name: v3-territory + build: + dockerfile: ci/Dockerfile + context: . + env_file: + - ci/.env.ci + ports: + - 5004:5004 + networks: + - v3-network + +networks: + v3-network: + name: v3-network + external: true