From 25a85fd2ffe2780efd3e4d55928eefdef53309e9 Mon Sep 17 00:00:00 2001 From: lamya-rey Date: Mon, 18 Jan 2021 09:35:17 +0100 Subject: [PATCH] :construction_worker: add working directory --- .circleci/config.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f60036..f7e451c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,26 +20,34 @@ jobs: test: docker: - image: circleci/python:3.9-buster-node-browsers - environment: - DATABASE_URL: postgresql://postgres:root@localhost:5432/postgres - FLASK_APP: /home/circleci/repo/autoapp.py - CONDUIT_SECRET: 'something-really-secret' - FLASK_DEBUG: 1 - POSTGRES_PORT: 5432 - image: circleci/postgres:9.6.2-alpine environment: POSTGRES_USER: postgres POSTGRES_DB: postgres POSTGRES_PASSWORD: root + working_directory: ~/repo steps: - checkout - restore_cache: key: dependencies-{{ checksum "requirements/dev.txt"}}-{{ checksum "requirements/prod.txt" }} + + - run: + name: db upgrade + command: | + . venv/bin/activate + sleep 1 + flask db upgrade + environment: + CONDUIT_SECRET: 'something-really-secret' + FLASK_APP: /home/circleci/repo/autoapp.py + DATABASE_URL: postgresql://postgres:root@localhost:5432/postgres + FLASK_DEBUG: 1 + POSTGRES_USER: myUser + POSTGRES_DB: mydb + POSTGRES_PASSWORD: somePwd + POSTGRES_PORT: 5432 - run: - name: sleep 1 - command : dockerize -wait tcp://localhost:5432 -timeout 1m - - run: - name: run test + name: db test command: | . venv/bin/activate flask db migrate