项目作者: lrothack

项目描述 :
Cookiecutter template for a dockerized dev-ops pipeline with SonarQube code quality monitoring
高级语言: Python
项目地址: git://github.com/lrothack/cookiecutter-pydevops.git
创建时间: 2020-06-10T00:19:42Z
项目社区:https://github.com/lrothack/cookiecutter-pydevops

开源协议:MIT License

下载


Cookiecutter PyDevops

Cookiecutter template for a dockerized dev-ops pipeline with SonarQube code-quality monitoring.
Cookiecutter provides a command-line interface for creating projects from templates.

Features

The template provides a minimal dev-ops pipeline that supports:

The dev-ops pipeline is mostly implemented in a Makefile and a Dockerfile which are
independent of your Python code.

Quickstart

Install the latest cookiecutter:

  1. pip install -U cookiecutter

Generate an instance of the template:

  1. cookiecutter https://github.com/lrothack/cookiecutter-pydevops.git

Then switch to the project directory and:

  • Set up a virtual environment for your project and activate it (requires Python >= 3.6).
  • Run make help in order to get an overview of the targets provided by Makefile.
  • Run make install-dev in order to install the package (and all dependencies) in development mode.
  • Run make lint in order to run code analysis with pylint and bandit.
  • Run make test in order to run unit tests with pytest and coverage.
  • Run make dist in order to build a Python package (binary and source).
  • Run docker-compose -p sonarqube -f sonarqube/docker-compose.yml up -d in order to start a SonarQube server.
  • Run make sonar in order to run sonar-scanner and report results to your local SonarQube server. Make sure to create a SonarQube authentication token before. Save the token in the file .sonartoken within your project directory.
  • Run make docker-build in order to analyze, test, package and deploy in a multi-stage Docker build. Test your docker image with docker run.

Advanced configurations can be made in the configuration sections of Makefile. See lrothack/dev-ops for more information.