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.
 
 
 

98 lines
2.7 KiB

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