Skip to content

Commit

Permalink
Merge pull request #18 from jryusuf/feature-2
Browse files Browse the repository at this point in the history
Update README with CI/CD instructions and branch protection rules
  • Loading branch information
jryusuf authored Feb 6, 2024
2 parents edaa5a2 + dc172b3 commit e9a85ca
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ Dev container project with readily populated vscode extensions and some basic gi

## CI/CD
When you commit it will run Black for linting and correct the formatting errors

When you push your project to any branch other than main or release it will run pytest with github actions

When you create a pull request to release branch it will run the tests, generate your docker image and push it your docker image repository

When you create a pull request it will run the test, you can more step for your application

## Python Modules
Fastapi

Pytest for unit tests

Black

Pre-commit for linting

## Running
Expand All @@ -23,25 +29,37 @@ It comes with requirements.txt file and automatically install all modules during
## Creating your project
After running up the dev container, you need to rename your project and change the remote of your origin for git

Create master for deployment and release branches for builds, or you can rename them however you see fit. If you change the branch names do not forget to change the github action on tags with the new ones in the .github/workflows folder. Don't forget to create branch protection rules for these branches with the listed options:
Create master for deployment and release branches for builds, or you can rename them however you see fit. If you change the branch names do not forget to change the github action on tags with the new ones in the .github/workflows folder.


on:

pull_request:

Require a pull request before merging
Require review from Code Owners
Require status checks to pass before merging
Require bracnhes to be up to date before merging
Status checks that are required: Select [Deployment-Test] or [Release-Test-And-Artifact]
branches:

on:
pull_request:
branches:
- master or release(<-----update here)
- master or release(<-----update here)

Don't forget to create branch protection rules for these branches with the listed options:

Require a pull request before merging

Require review from Code Owners

Require status checks to pass before merging

Require bracnhes to be up to date before merging

Status checks that are required: Select [Deployment-Test] or [Release-Test-And-Artifact]

This project containes a docker image file and when you create a pull request to relase branch it will create the docker image and publish it to your docker image hub

Update the tags at the end of the release-test-and-image-creating.yaml file with your own docker repo information

For authentication of your docker repo you need to create 2 repository secrets in your repo settings:
DOCKER_PASSWORD
DOCKER_USERNAME

DOCKER_PASSWORD

DOCKER_USERNAME

For deployment you can update the master-test-and-deployment.yaml file for custom deployment strategy with some other github actions

0 comments on commit e9a85ca

Please sign in to comment.