Yield generated for 619db31d-e3a4-4e3e-ad5e-f3b990980ae4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
1.5 KiB

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
- 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:5432 -timeout 1m
- run:
name : test
command: |
. venv/bin/activate
flask db upgrade
flask test
workflows:
version: 2.1
build-test:
jobs:
- build
- test:
context:
- back_final
requires:
- build