From a7b4b333a5dbca3b96b1ddb36d3d4c3ae2d877bc Mon Sep 17 00:00:00 2001 From: plazmoid Date: Thu, 14 Oct 2021 05:14:04 +0500 Subject: [PATCH] gen_schema restored --- Makefile.toml | 4 +++- images/integration-tests/u_db_entrypoint.sh | 3 ++- integration/docker-compose.yml | 11 ++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 44d8f2d..de6a2f0 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -41,7 +41,9 @@ bash integration_tests.sh [tasks.gen_schema] script = ''' cd ./integration -docker-compose up -d u_server +docker-compose up -d u_db_gen_schema +echo "Waiting 10 sec..." +sleep 10 docker-compose down ''' diff --git a/images/integration-tests/u_db_entrypoint.sh b/images/integration-tests/u_db_entrypoint.sh index e67acc1..eb96742 100755 --- a/images/integration-tests/u_db_entrypoint.sh +++ b/images/integration-tests/u_db_entrypoint.sh @@ -1,5 +1,6 @@ set -m export DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@127.0.0.1/${DB_NAME} +touch /unki/Cargo.toml /usr/local/bin/docker-entrypoint.sh postgres & -sleep 10 && diesel setup && fg %1 \ No newline at end of file +sleep 10 && diesel setup && diesel migration run && fg %1 \ No newline at end of file diff --git a/integration/docker-compose.yml b/integration/docker-compose.yml index 848d792..84255c3 100644 --- a/integration/docker-compose.yml +++ b/integration/docker-compose.yml @@ -42,7 +42,6 @@ services: working_dir: /unki volumes: - ../migrations:/unki/migrations - - ../Cargo.toml:/unki/Cargo.toml command: /unki/u_db_entrypoint.sh healthcheck: # test if db's port is open and db is created @@ -51,6 +50,16 @@ services: timeout: 5s retries: 3 + u_db_gen_schema: + image: unki/u_db + env_file: + - ../.env + - ../.env.private + working_dir: /unki + volumes: + - ../:/unki/ + command: /unki/images/integration-tests/u_db_entrypoint.sh + u_agent_1: image: unki/u_agent networks: