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