diff --git a/.circleci/config.yml b/.circleci/config.yml index 73ff124..299aa8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,17 @@ version: 2.1 jobs: build: docker: - - image: circleci/python:3.9 + - image: circleci/python:3.7 + environment: + DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/psdb + FLASK_APP: autoapp.py + CONDUIT_SECRET: 'something-really-secret' + FLASK_DEBUG: 1 + - image: circleci/postgres:9.6.5-alpine-ram + environment: + POSTGRES_USER: myUsr + POSTGRES_DB: psdb + POSTGRES_PASSWORD: somePwd steps: - checkout - restore_cache: @@ -12,13 +22,14 @@ jobs: python3 -m venv venv . venv/bin/activate pip install -r requirements/dev.txt + - save_cache: key: deps-{{ checksum "requirements/dev.txt"}}-{{ .Environment.CACHE_VERSION }} paths: - "venv" test: docker: - - image: circleci/python:3.9 + - image: circleci/python:3.7 environment: DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/psdb FLASK_APP: autoapp.py @@ -39,8 +50,8 @@ jobs: name: Launching tests command: | . venv/bin/activate - python3.9 -m flask db upgrade - python3.9 -m flask test + python3.7 -m flask db upgrade + python3.7 -m flask test deploy-heroku: docker: - image : buildpack-deps:trusty @@ -49,7 +60,7 @@ jobs: - run: command: | git config --global push.default matching - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git main + git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git mainhero - run: name: Smoke test command: | diff --git a/Procfile b/Procfile index 60df632..a96c523 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn autoapp:app -b 0.0.0.0:$PORT -w 3 +web: flask db upgrade;gunicorn autoapp:app -b 0.0.0.0:$PORT -w 3