Browse Source

💚 refacto and other test for db

main
Julien Dudek 6 years ago
parent
commit
4a4efd7c7f
  1. 30
      .circleci/config.yml

30
.circleci/config.yml

@ -72,30 +72,28 @@ jobs:
# fallback to using the latest cache if no exact match is found
- run:
name: bd upgrade
name: install dockerize
command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
environment:
DOCKERIZE_VERSION: v0.3.0
- run:
name: Wait for db
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Migrate Database
command: |
export CONDUIT_SECRET='something-really-secret'
export FLASK_APP=/home/circleci/repo/autoapp.py
export FLASK_DEBUG=1
export DATABASE_URL=postgresql://myUsr:somePwd@localhost:5432/postgres
. venv/bin/activate
sleep 1
flask db upgrade
environment:
CONDUIT_SECRET: 'something-really-secret'
FLASK_APP: /home/circleci/repo/autoapp.py
DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/myUsr
FLASK_DEBUG: 1
flask db migrate
# run tests!
# this example uses Django's built-in test-runner
# other common Python testing frameworks include pytest and nose
# https://pytest.org
# https://nose.readthedocs.io
- run:
name: run tests
command: |
. venv/bin/activate
flask db migrate
flask test
environment:
CONDUIT_SECRET: 'something-really-secret'

Loading…
Cancel
Save