Throughout the project, we will explore various aspects of DevOps, including application development, containerization with Docker, creating CI/CD pipelines, managing Kubernetes clusters, and implementing effective monitoring practices.
To Establish a Robust and Reliable Development process by settting version control using Git, implementing comprehensive Unit Tests, and setting up effective workflows to ensure that only properly tested code is merged from other branches into the Master branch.
Git clone initial code from this Github Repo - https://github.com/iboofaye/devops-full-practical-bootcamp
git clone git@github.com:iboofaye/devops-full-practical-bootcamp.git
1.) Create a directory called .github/workflows within the directory containing .git 2.) And create a workflow ‘YAML’ file, let's call it ci_cd_wf.yml 3.) Git add and push changes (This automatically invokes the Git actions and sets up the CI/CD Pipeline which on push to the master branch)
name : test
on:
push:
branches:
- main
jobs:
test:
runs-on : ubuntu-latest
steps:
- name: Check out repo code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install Dependencies
run: |
python -m pip install -r requirements.txt
- name: Run tests
run: |
python -m pytest calculator.py
Now that the initial code is in place, it's time to focus on improving its quality. One way to do this is to add more checks such as linters, code coverage, and code quality checks.
Another recommended step is to add 'runs on' actions like a pull request. This allows for a more streamlined workflow and can help ensure that the code changes are thoroughly tested before being merged into the main branch.
This repository has three branches -