From db8e33c8f705053775a623b6294eb3bb75ed656c Mon Sep 17 00:00:00 2001 From: Pierre Fontaine Date: Mon, 18 Jan 2021 09:08:26 +0100 Subject: [PATCH] :wrench: Add CircleCI folder and steps to build the app. --- .circleci/config.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ace88c0 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,38 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/python + - image: circleci/postgres + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - dependencies-{{ checksum "requirements/dev.tx" }}-{{ checksum "requirements/prod.txt" }} + # fallback to using the latest cache if no exact match is found + - dependencies- + - run: + name: Install dependencies + command: pip install -r requirements/dev.txt --user + - run: docker container run --name flask_db_test -e POSTGRES_PASSWORD=somePwd -e POSTGRES_USER=myUsr -p 5432:5432 -d postgres + - run: sleep 1 + - run: + name: Setup dababase + environment: + POSTGRES_DB: psqluer + POSTGRES_USER: myUsr + POSTGRES_PASSWORD: somePwd + DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/myUsr + FLASK_DEBUG: 0 + command: flask db upgrade + + + + exit 1; \ + fi +workflows: + version: 2 + build-test: + jobs: + - build \ No newline at end of file