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.
41 lines
1.1 KiB
41 lines
1.1 KiB
version: 2
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- image: circleci/python:3.9.1
|
|
- image: circleci/postgres:9.6.5
|
|
environment:
|
|
POSTGRES_DB: example
|
|
POSTGRES_USER: circleci
|
|
POSTGRES_PASSWORD: somePwd
|
|
POSTGRES_PORT: 5432
|
|
DATABASE_URL: postgresql://circleci:somePwd@localhost:5432/example
|
|
working_directory: ~/repo
|
|
steps:
|
|
- checkout
|
|
- setup_remote_docker
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
|
|
# fallback to using the latest cache if no exact match is found
|
|
- dependencies-
|
|
- run:
|
|
name: Install dependencies
|
|
command: |
|
|
python3 -m venv venv
|
|
. venv/bin/activate
|
|
pip install -r requirements/dev.txt
|
|
- run:
|
|
name: Setup dababase
|
|
environment:
|
|
FLASK_APP: /home/circleci/repo/autoapp.py
|
|
FLASK_DEBUG: 0
|
|
command: |
|
|
. venv/bin/activate
|
|
flask db upgrade
|
|
|
|
workflows:
|
|
version: 2
|
|
build-test:
|
|
jobs:
|
|
- build
|