- Notifications
You must be signed in to change notification settings - Fork230
Blueprint/Boilerplate For Python Projects
License
MartinHeinz/python-project-blueprint
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
If you find this useful, you can support me on Ko-Fi (Donations are always appreciated, but never required):
You can find more information about this project/repository and how to use it in following blog post:
- Ultimate Setup for Your Next Python Project
- Automating Every Aspect of Your Python Project
- Deploy Any Python Project to Kubernetes
- Implementing gRPC server using Python
To use this repository as starter for your project you can runconfigure_project.sh script, which sets up all variables and file names. This way you can avoid configuring and renaming things yourself:
./configure_project.sh MODULE="coolproject" REGISTRY="docker.pkg.github.com/martinheinz/repo-name"
~ $ make runDevelopment image:
~ $ make build-dev~ $ docker images --filter "label=name=blueprint"REPOSITORY TAG IMAGE ID CREATED SIZEdocker.pkg.github.com/martinheinz/python-project-blueprint/blueprint 3492a40-dirty acf8d09acce4 28 seconds ago 967MB~ $ docker run acf8d09acce4Hello World...
Production (Distroless) image:
~ $ make build-prod VERSION=0.0.5~ $ docker images --filter "label=version=0.0.5"REPOSITORY TAG IMAGE ID CREATED SIZEdocker.pkg.github.com/martinheinz/python-project-blueprint/blueprint 0.0.5 65e6690d9edd 5 seconds ago 86.1MB~ $ docker run 65e6690d9eddHello World...
Test are ran every time you builddev orprod image. You can also run tests using:
~ $ make test~ $ docker login docker.pkg.github.com --username MartinHeinzPassword: ......Login Succeeded~ $ make push VERSION=0.0.5
CleanPytest and coverage cache/files:
~ $ make cleanCleanDocker images:
~ $ make docker-cleanApplication can be easily deployed onk8s usingKinD.
To create cluster and/or view status:
~ $ make clusterTo deploy application to local cluster:
~ $ make deploy-localTo get debugging information of running application:
~ $ make cluster-debugTo get remote shell into application pod:
~ $ make cluster-rshTo apply/updateKubernetes manifest stored ink8s directory:
~ $ make manifest-update- Navigate tohttps://sonarcloud.io/projects
- Clickplus in top right corner -> analyze new project
- Setup withother CI tool ->other ->Linux
- Copy
-Dsonar.projectKey=and-Dsonar.organization=- These 2 values go to
sonar-project.propertiesfile
- These 2 values go to
- Click pencil at bottom of
sonar-scannercommand - Generate token and save it
- Go to repo ->Settings tab ->Secrets ->Add a new secret
- name:
SONAR_TOKEN - value:Previously copied token
- name:
Token is needed for example forGitHub Package Registry. To create one:
- Go toSettings tab
- ClickSecrets
- ClickAdd a new secret
- Name:name that will be accessible in GitHub Actions as
secrets.NAME - Value:value
- Name:name that will be accessible in GitHub Actions as
About
Blueprint/Boilerplate For Python Projects
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.