Yield generated for a510eb8d-a22a-494c-9dcf-6b7a4ca200d4
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.
 
 
 

82 lines
2.1 KiB

version: 2.1
commands:
restore_cache_cmd:
description: "Restore cache from a previous workflow"
steps:
- restore_cache:
keys:
- deps1-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
- deps1-{{ .Branch }}-
save_cache_cmd:
description: "save cache with workflow new state"
steps:
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
paths:
- "venv"
executors:
docker-python-executor:
docker:
- image: circleci/python:3.7.9-stretch
auth:
username: morganlmd
password: $DOCKERHUB_PASSWORD
environment:
CONDUIT_SECRET: "something-really-secret"
FLASK_APP: /home/circleci/repo/autoapp.py
FLASK_DEBUG: 1
docker-postgres-executor:
docker:
- image: circleci/python:3.7.9-stretch
environment:
CONDUIT_SECRET: "something-really-secret"
FLASK_APP: autoapp.py
FLASK_DEBUG: 1
DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/myUsr
- image: circleci/postgres:9.6.5-alpine
environment:
POSTGRES_USER: myUsr
POSTGRES_DB: myUsr
POSTGRES_PASSWORD: somePwd
jobs:
initial-build:
executor: docker-python-executor
steps:
- checkout
- restore_cache_cmd
- run:
name: setup environment and install python dependencies in a venv
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements/dev.txt
- save_cache_cmd
setup-and-test-db:
executor: docker-postgres-executor
steps:
- checkout
- restore_cache_cmd
- run:
name: testing connection between database and backend
command: |
. venv/bin/activate
sleep 1
flask db upgrade
flask test
- save_cache_cmd
workflows:
version: 2
build-test-back-and-db:
jobs:
- initial-build
- setup-and-test-db:
requires:
- initial-build