Yield generated for b848a7ac-fa4a-4be7-ac2d-d0c981854c8c
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.
 
 
 

60 lines
1.8 KiB

jobs:
install:
docker:
- image: circleci/python:3.6.4
- image: circleci/postgres:9.6.2
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
- dependencies-
- run:
name: install python and dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements/dev.txt
- run:
name: db upgrade
environment:
FLASK_APP: /home/circleci/repo/autoapp.py
FLASK_DEBUG: 1
POSTGRES_USER: postgres
POSTGRES_DB: bdtest
POSTGRES_PASSWORD: somePwd
POSTGRES_PORT: 5432
DATABASE_URL: postgresql://postgres:somePwd@localhost:5432/postgres
command: |
echo $FLASK_APP
echo $FLASK_DEBUG
echo $DATABASE_URL
. venv/bin/activate
flask db upgrade
- run:
name: flask test
environment:
FLASK_APP: /home/circleci/repo/autoapp.py
FLASK_DEBUG: 1
POSTGRES_USER: postgres
POSTGRES_DB: bdtest
POSTGRES_PASSWORD: somePwd
POSTGRES_PORT: 5432
DATABASE_URL: postgresql://postgres:somePwd@localhost:5432/postgres
TESTENV: "pour tester les var env"
command: |
echo $DATABASE_URL
echo $TESTENV
. venv/bin/activate
flask test
- save_cache:
paths:
- ./venv
key: dependencies-{{ checksum "requirements/dev.txt" }}-{{ checksum "requirements/prod.txt" }}
workflows:
version: 2
build-back:
jobs:
- install