diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..fe06fb2 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,58 @@ +version: 2.1 +workflows: + version: 2 + devopsTP4: + jobs: + - install + +jobs: + install: + docker: + - image: cimg/python:3.9.1 + - image: circleci/postgres:9.6.2 + working_directory: ~/repo + steps: + - checkout + - setup_remote_docker + - 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: docker container run --name flask_db_test -e POSTGRES_PASSWORD=somePwd -e POSTGRES_USER=myUsr -p 5432:5432 -d postgres + - run: sleep 1 + - run: + name: db upgrade + environment: + FLASK_APP: /home/circleci/repo/autoapp.py + FLASK_DEBUG: 0 + POSTGRES_USER: postgres + POSTGRES_DB: bdtest + POSTGRES_PASSWORD: somePwd + POSTGRES_PORT: 5432 + DATABASE_URL: postgresql://postgres:somePwd@localhost:5432/postgres + command: | + . venv/bin/activate + flask db upgrade + - run: + name: flask test + environment: + FLASK_APP: /home/circleci/repo/autoapp.py + FLASK_DEBUG: 0 + POSTGRES_USER: postgres + POSTGRES_DB: bdtest + POSTGRES_PASSWORD: somePwd + POSTGRES_PORT: 5432 + DATABASE_URL: postgresql://postgres:somePwd@localhost:5432/postgres + command: | + . venv/bin/activate + flask test + - run: docker container stop flask_db_test + - run: docker container rm flask_db_test + - run: unset DATABASE_URL diff --git a/conduit/settings.py b/conduit/settings.py index b838a6d..cbe8344 100644 --- a/conduit/settings.py +++ b/conduit/settings.py @@ -25,6 +25,7 @@ class Config(object): 'http://localhost:4200', 'http://0.0.0.0:4000', 'http://localhost:4000', + 'https://devops-tp-final-front.netlify.app', ] JWT_HEADER_TYPE = 'Token'