Giter Site home page Giter Site logo

narayanadithya / flask-poetry Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 32 KB

Flask Project Made with Poetry

Home Page: https://hub.docker.com/repository/docker/narayanadithya/flaskpoetry

Python 71.18% Dockerfile 28.82%
automation bandit cicd docker flake8 flask jenkins poetry pytest

flask-poetry's Introduction

Build Status

About

This project aims to implement a standard CI/CD pipeline for a Flask project whose dependencies are managed using Poetry. This repository is a major improvement on my last attempt to create a CI/CD pipeline for a basic python application build using the Flask microframework.

Poetry

Poetry is a python dependecy manager which is very much analogous to npm for JS projects. With Poetry one can isolate all the dependencies in a Poetry.lock file which can then ensure that the versions are maintained while shifting via environments. Poetry also helps group dependencies into dev dependecies and main dependencies. It also provides you the advantage of defining scripts just like one would define in package.json. Poetry generates a pyproject.toml file which has become the standard for defining the package details and configuration of tools like flake8, bandit and PyTest.

Stages in CI Pipeline and Associated Commands

  1. Install Environment - poetry install
  2. Run Linting - poetry run flake8 .
  3. Vulnerability Check - poetry run bandit -r . -c "pyproject.toml"
  4. Run Unit Test - poetry run pytest .
  5. Bump Version - poetry version patch
  6. Commit Version Update and Push Changes
  7. Build Docker Image from Dockerfile
  8. Docker Login
  9. Push Image to DockerHub Repository

Jenkins

A multibranch project has been setup with a Multibranch webhook trigger setup to build the latest release on a commit. The Jenkins has also been configured with Build Trigger Extension to prevent build on certain file changes like README.md etc. The Embeddable Status Plugin was used to create the badge shown on the top of the README.md file. Jenkins is making use of two custom defined libraries one for poetry and one for normal python build commands. These repo's can be found here and here

flask-poetry's People

Contributors

narayanadithya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.