From 7e81022a326211b9b466836fa3c66653e8748a72 Mon Sep 17 00:00:00 2001 From: sbriat Date: Fri, 17 Mar 2023 11:34:17 +0100 Subject: [PATCH] simplify test ci --check --- .env.dist | 5 +---- .env.test | 5 +---- ci/.env.ci | 4 ++-- ci/wait-up.sh | 2 +- docker-compose.ci.tools.yml | 16 ++++++++-------- docker-compose.yml | 32 -------------------------------- 6 files changed, 13 insertions(+), 51 deletions(-) diff --git a/.env.dist b/.env.dist index 46237a4..549d2ae 100644 --- a/.env.dist +++ b/.env.dist @@ -3,11 +3,8 @@ SERVICE_URL=0.0.0.0 SERVICE_PORT=5003 # PRISMA -DATABASE_URL="postgresql://configuration:configuration@v3-configuration-db:5432/configuration?schema=public" +DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=configuration" # RABBIT MQ RMQ_URI=amqp://v3-broker:5672 RMQ_EXCHANGE=mobicoop - -# POSTGRES -POSTGRES_IMAGE=postgres:15.0 diff --git a/.env.test b/.env.test index 00ac0af..eaeeb7c 100644 --- a/.env.test +++ b/.env.test @@ -3,7 +3,4 @@ SERVICE_URL=0.0.0.0 SERVICE_PORT=5003 # PRISMA -DATABASE_URL="postgresql://configuration:configuration@localhost:5603/configuration?schema=public" - -# POSTGRES -POSTGRES_IMAGE=postgres:15.0 +DATABASE_URL="postgresql://mobicoop:mobicoop@localhost:5432/mobicoop?schema=configuration-test" diff --git a/ci/.env.ci b/ci/.env.ci index 5351dcd..440e31c 100644 --- a/ci/.env.ci +++ b/ci/.env.ci @@ -3,10 +3,10 @@ SERVICE_URL=0.0.0.0 SERVICE_PORT=5003 # PRISMA -DATABASE_URL="postgresql://configuration:configuration@v3-configuration-db-test:5432/configuration?schema=public" +DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=public" # RABBIT MQ -RMQ_URI=amqp://v3-configuration-broker:5672 +RMQ_URI=amqp://v3-broker:5672 # MESSAGE BROKER BROKER_IMAGE=rabbitmq:3-alpine diff --git a/ci/wait-up.sh b/ci/wait-up.sh index 50146ef..f29be44 100644 --- a/ci/wait-up.sh +++ b/ci/wait-up.sh @@ -1,6 +1,6 @@ #!/bin/bash testlog() { - docker logs v3-configuration-db-test | grep -q "database system is ready to accept connections" + docker logs v3-db | grep -q "database system is ready to accept connections" } testlog 2> /dev/null diff --git a/docker-compose.ci.tools.yml b/docker-compose.ci.tools.yml index 16a85f2..a72f134 100644 --- a/docker-compose.ci.tools.yml +++ b/docker-compose.ci.tools.yml @@ -1,20 +1,20 @@ version: '3.8' services: - v3-configuration-db-test: - container_name: v3-configuration-db-test + db: + container_name: v3-db image: ${POSTGRES_IMAGE} environment: - POSTGRES_DB: configuration - POSTGRES_USER: configuration - POSTGRES_PASSWORD: configuration + POSTGRES_DB: mobicoop + POSTGRES_USER: mobicoop + POSTGRES_PASSWORD: mobicoop ports: - - 5603:5432 + - 5432:5432 networks: - v3-network - v3-configuration-broker: - container_name: v3-configuration-broker + broker: + container_name: v3-broker image: ${BROKER_IMAGE} ports: - 5672:5672 diff --git a/docker-compose.yml b/docker-compose.yml index ea9dc6e..958f5f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,43 +14,11 @@ services: command: npm run start:dev ports: - ${SERVICE_PORT:-5003}:${SERVICE_PORT:-5003} - depends_on: - - v3-configuration-db networks: v3-network: aliases: - v3-configuration-api - v3-configuration-db: - container_name: v3-configuration-db - image: ${POSTGRES_IMAGE} - environment: - POSTGRES_DB: configuration - POSTGRES_USER: configuration - POSTGRES_PASSWORD: configuration - ports: - - 5503:5432 - volumes: - - .postgresql:/var/lib/postgresql/data:rw - networks: - v3-network: - aliases: - - v3-configuration-db - - v3-configuration-db-test: - container_name: v3-configuration-db-test - image: ${POSTGRES_IMAGE} - environment: - POSTGRES_DB: configuration - POSTGRES_USER: configuration - POSTGRES_PASSWORD: configuration - ports: - - 5603:5432 - networks: - v3-network: - aliases: - - v3-configuration-db-test - networks: v3-network: name: v3-network