Implement Docker, docker-compose and CI/CD (with Kubernetes)#1
Merged
Conversation
Run MongoDB and forms-backend in Docker to make local development easier.
I want to use GH helper for Workflow files, but this require to already have file.
Run flake8 every time when pushing to main or to PR.
|
Thank you for contributing to Python Discord! Please check out the following documents:
|
Removed 2nd ', what gave error. Removed adding environment variable to PATH that don't exist.
Use PyCharm import order, copy flake8 rules ignore list from other PyDis projects.
Co-authored-by: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com>
Co-authored-by: Joe Banks <joseph@josephbanks.me>
jb3
previously approved these changes
Nov 24, 2020
SebastiaanZ
reviewed
Nov 25, 2020
Comment on lines
+1
to
+32
| { | ||
| "problemMatcher": [ | ||
| { | ||
| "owner": "flake8-error", | ||
| "severity": "error", | ||
| "pattern": [ | ||
| { | ||
| "regexp": "^([^:]*):(\\d+):(\\d+): ([EF]\\d\\d\\d) (.*)$", | ||
| "file": 1, | ||
| "line": 2, | ||
| "column": 3, | ||
| "code": 4, | ||
| "message": 5 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "owner": "flake8-warning", | ||
| "severity": "warning", | ||
| "pattern": [ | ||
| { | ||
| "regexp": "^([^:]*):(\\d+):(\\d+): ([W]\\d\\d\\d) (.*)$", | ||
| "file": 1, | ||
| "line": 2, | ||
| "column": 3, | ||
| "code": 4, | ||
| "message": 5 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
Contributor
There was a problem hiding this comment.
How will these matchers react to the error codes of flake8-annotations, ANN001? They don't match either pattern, as your pattern for errors only matched [EF] in the error code section and your warning one only [W]. A slightly less sophisticated method would be to have flake8 output its error messages in the proper format for annotations directly.
This means you wouldn't have to worry about the CI when error codes change in the future (e.g., we add more plugins).
SebastiaanZ
previously approved these changes
Nov 26, 2020
jb3
requested changes
Nov 26, 2020
Member
jb3
left a comment
There was a problem hiding this comment.
Need to fetch the environment for the container
Co-authored-by: Joe Banks <joseph@josephbanks.me>
jb3
approved these changes
Nov 26, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docker
Created
Dockerfile,.dockerignoreanddocker-compose.ymlfiles to Docker image building and local development. This uses nowuvicornin development environment andgunicornwithuvicornworker in production environment, as using plainuvicornis not suggested in production.docker-composealso run MongoDB instance and pass database information tobackendcontainer.CI/CD, Kubernetes
Created following CI/CD jobs for GH Actions:
Lintingsuccess and branch ismain.Build & Pushsuccess and branch ismain.Required new secrets:
GHCR_USERGHCR_TOKENKUBECONFIGOther changes
ALLOWED_URLvariable that defaults to current hard-coded value.