version: 2.1 jobs: build: docker: - image: python:3.8-buster working_directory: ~/back steps: - checkout - restore_cache: key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} - run: name: set env vars command: | export CONDUIT_SECRET='something-secret' export FLASK_APP=./autoapp.py export FLASK_DEBUG=1 - run : name: install deps command: | python3 -m venv venv . venv/bin/activate pip install -r requirements/dev.txt - save_cache: key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} paths: - "venv" test: docker: - image: python:3.8-buster environment: DATABASE_URL: postgresql://myUsr:somePwd@localhost:5433/psdb - image: circleci/postgres:9.6.2-alpine environment: POSTGRES_USER: $POSTGRES_USER POSTGRES_DB: psdb POSTGRES_PASSWORD: $POSTGRES_PASSWORD steps: - checkout - restore_cache: key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} - run: name: postgres command : dockerize -wait tcp://localhost:5433 -timeout 1m - run: name : testing command: | . venv/bin/activate flask db upgrade flask test workflows: version: 2.1 build-test: jobs: - build - test: context: - back_final requires: - build