Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 1.07 KB

File metadata and controls

77 lines (49 loc) · 1.07 KB

Python Example

Simple Python Flask app for the sake of demonstrating CI/CD with Jenkins. Shamelessly stolen from:

The basic blog app built in the Flask tutorial_.

.. _tutorial: https://flask.palletsprojects.com/tutorial/

Docker

Build

docker build -t python_example:latest .

Run

Interactive

docker run -it python_example:latest /bin/bash

Interactive with code mounted (for development)

docker run -it -v $(pwd):/opt/app python_example:latest /bin/bash

Non Interactive

docker run python_example:latest 

Local

Install

Install Flaskr

pip install -e .

Run

flask --app flaskr init-db
flask --app flaskr run --debug

Open http://127.0.0.1:5000 in a browser.

Test

Docker

docker run python_example:latest pytest

Local

pytest

Run with coverage report::

coverage run -m pytest
coverage report
coverage html  # open htmlcov/index.html in a browser