Yield generated for fc6e846b-39b2-463e-8cd5-f62c3995f676
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.
 
 
 

87 lines
2.5 KiB

workflows:
version: 2
build_circleci:
jobs:
- build
- initialise:
requires:
- build
- docker-build-and-push:
requires:
- initialise
- back-deploy-heroku:
requires:
- docker-build-and-push
version: 2
jobs:
build:
docker:
- image: circleci/python:3.7.4
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
- v2-dependencies-
- run:
name: install pyth dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements/dev.txt
environment:
CONDUIT_SECRET: 'something-really-secret'
FLASK_APP: /home/circleci/repo/autoapp.py
FLASK_DEBUG: 1
- save_cache:
paths:
- ./venv
key: v2-dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
initialise:
docker:
- image: circleci/python:3.7.4
environment:
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/mydb
- image: postgres:9.6.2-alpine
environment:
POSTGRES_DB: mydb
POSTGRES_USER: myuser
POSTGRES_PASSWORD: somePwd
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
- v2-dependencies-
- run:
name: flask upgrade
command: |
. venv/bin/activate
sleep 1
flask db upgrade
environment:
CONDUIT_SECRET: 'something-really-secret'
FLASK_APP: ./autoapp.py
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/mydb
FLASK_DEBUG: 1
POSTGRES_USER: myuser
POSTGRES_DB: mydb
POSTGRES_PASSWORD: somePwd
POSTGRES_PORT: 5432
- run:
name: flask test
command: |
. venv/bin/activate
sleep 1
flask test
environment:
CONDUIT_SECRET: 'something-really-secret'
FLASK_APP: ./autoapp.py
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/mydb
FLASK_DEBUG: 1
POSTGRES_USER: myuser
POSTGRES_DB: mydb
POSTGRES_PASSWORD: somePwd
POSTGRES_PORT: 5432