Browse Source

🚧 add postgres image

mytest-branch
tchawou-daniel 6 years ago
parent
commit
fc7ccbbcec
  1. 57
      .circleci/config.yml

57
.circleci/config.yml

@ -1,16 +1,61 @@
version: 2.1 version: 2.1
workflows: workflows:
build_and_test:
version: 2.1
build_circleci:
jobs: jobs:
- build - build
- initialise:
requires:
- build
- docker-build-and-push:
requires:
- initialise
- back-deploy-heroku:
requires:
- docker-build-and-push
jobs: jobs:
build: build:
docker: docker:
- image: circleci/python:3.6.2-stretch-browsers - image: circleci/python:3.6.2-stretch-browsers
steps: steps:
- checkout - checkout
- run: export CONDUIT_SECRET='something-really-secret'
- run: export FLASK_APP=autoapp.py
- run: export FLASK_DEBUG=1
- run:
name: install pyth dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip3 install -r requirements/dev.txt
- save_cache:
paths:
- ./venv
key: v2-dependencies-{{ checksum "requirements/dev.txt" }}
initialise:
docker:
- image: circleci/python:3.6.2-stretch-browsers
environment:
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/myuser
- image: circleci/postgres:9.6.5
environment:
POSTGRES_DB: myuser
POSTGRES_USER: myuser
POSTGRES_PASSWORD: somePwd
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "requirements/dev.txt" }}
- v2-dependencies-
- run:
name: flask upgrade
command: |
. venv/bin/activate
sleep 1
flask db upgrade
- run:
name: flask test
command: |
. venv/bin/activate
sleep 1
flask test
Loading…
Cancel
Save