Project Name= CI/CD Final Project
Written by Brian McCarthy
This repository represents the Continuous Integration and Continuous Delivery (CI/CD) final project. It contains a RESTful API counter microservice built in Python, integrated with a fully functional automated CI/CD lifecycle using GitHub Actions for Continuous Integration and Tekton (OpenShift Pipelines) for Continuous Deployment.
The mission of this project is to automate the linting, unit testing, image building, and deployment of a Python RESTful microservice to ensure maximum operational safety, reliability, and automated speed.
- Programming Language: Python (
3.8/3.9) - Backend Framework: Flask / RESTful API design
- CI Engine: GitHub Actions
- CD Engine: Tekton Pipelines (OpenShift Pipelines)
- Containerization: Docker / Buildah
- Linting Tool: Flake8
- Testing Framework: Nose (unit testing with coverage reporting)
The project has the following modular file structure:
cicd-final-project/
│
├── .github/
│ └── workflows/
│ └── workflow.yml # GitHub Actions CI pipeline trigger on push/PR
│
├── .tekton/
│ └── tasks.yml # Tekton Tasks definition (cleanup, nose unit test)
│
├── service/
│ ├── __init__.py # Packages initialization
│ ├── models.py # REST API models & local state storage
│ └── routes.py # RESTful endpoint routes (written by Brian McCarthy)
│
├── tests/
│ ├── __init__.py # Test package initialization
│ └── test_routes.py # Unit test assertions
│
├── requirements.txt # Python environment dependencies
├── README.md # This project design & deliverables document (by Brian McCarthy)
└── setup.cfg # Tool configuration files (such as flake8)
This project fulfills the following 10-point scoring requirements (Total: 20 points, requires 14 points / 70% to pass):
- Repositories are cleanly structured and named
cicd-final-project. - The
README.mddetails of the project are explicitly outlined here.
- Defined in
.github/workflows/workflow.yml. - Contains automated checkout and dependency installation.
- Runs the Lint with flake8 step to enforce PEP 8 guidelines.
- Runs Run unit tests with nose with full coverage tracking.
- Defined in
.tekton/tasks.yml. - Includes a cleanup task to securely scour the working directory.
- Includes a nose unit test task executing inside standard lightweight containers.
- Set up dynamically to secure persistent workspace storage on OpenShift clusters.
- Configured with Storage Class:
skills-network-learnerand Size:1Gi.
- Verification terminal output demonstrating successful workflow runs.
- Complete deployment workflow containing stages:
cleanup➔git-clone➔flake8-linting➔nose-tests➔buildah-image-build➔openshift-deploy.
- Completed pipeline pipeline-run displaying successful execution metrics.
- Container stream logs representing stateful counter tracking.
- Ensure Python 3.8+ is installed:
python --version
- Clone the repository and change directory:
git clone https://github.com/BrianGator/cicd-final-project.git cd cicd-final-project - Set up the development virtual environment and install dependencies:
python -m venv venv source venv/bin/activate pip install -r requirements.txt
- To run Linters (flake8):
flake8 service --count --select=E9,F63,F7,F82 --show-source --statistics
- To run Unit Tests (nose):
nosetests -v --with-spec --spec-color --with-coverage --cover-package=service
Written by Brian McCarthy