diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2517167..b525df1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,8 +16,9 @@ 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.tools.yml -p user-tools --env-file ci/.env.ci up -d - sh ci/wait-up.sh + - docker-compose -f docker-compose.ci.service.yml -p user-service --env-file ci/.env.ci up -d - docker exec -t v3-user sh -c "npm run test:integration:ci" coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ rules: diff --git a/ci/.env.ci b/ci/.env.ci index bc9fdb7..c5a4cff 100644 --- a/ci/.env.ci +++ b/ci/.env.ci @@ -13,3 +13,8 @@ BROKER_IMAGE=rabbitmq:3-alpine # POSTGRES POSTGRES_IMAGE=postgres:15.0 + +# REDIS +REDIS_IMAGE=redis:7.0-alpine +REDIS_HOST=v3-user-redis +REDIS_PORT=6379 diff --git a/docker-compose.ci.service.yml b/docker-compose.ci.service.yml new file mode 100644 index 0000000..a46406e --- /dev/null +++ b/docker-compose.ci.service.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + api: + container_name: v3-user + build: + dockerfile: ci/Dockerfile + context: . + env_file: + - ci/.env.ci + ports: + - 5001:5001 + depends_on: + - db + - broker + networks: + - v3-network + +networks: + v3-network: + name: v3-network + external: true diff --git a/docker-compose.ci.yml b/docker-compose.ci.tools.yml similarity index 76% rename from docker-compose.ci.yml rename to docker-compose.ci.tools.yml index e8cb3a1..0b5a24e 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.tools.yml @@ -1,18 +1,13 @@ version: '3.8' services: - api: - container_name: v3-user - build: - dockerfile: ci/Dockerfile - context: . + redis: + container_name: v3-user-redis + image: ${REDIS_IMAGE} + ports: + - 6501:6379 env_file: - ci/.env.ci - ports: - - 5001:5001 - depends_on: - - db - - broker networks: - v3-network