https://github.com/christian-schw/ci-cd-final-project
Final Project of IBM Course: "Continuous Integration and Delivery (CI/CD)" - Building CI/CD Pipelines
https://github.com/christian-schw/ci-cd-final-project
ci-cd devops github-actions kubernetes openshift tekton
Last synced: 8 months ago
JSON representation
Final Project of IBM Course: "Continuous Integration and Delivery (CI/CD)" - Building CI/CD Pipelines
- Host: GitHub
- URL: https://github.com/christian-schw/ci-cd-final-project
- Owner: christian-schw
- License: apache-2.0
- Created: 2024-12-08T11:01:40.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T11:54:29.000Z (10 months ago)
- Last Synced: 2024-12-08T12:19:32.553Z (10 months ago)
- Topics: ci-cd, devops, github-actions, kubernetes, openshift, tekton
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Building CI/CD Pipelines
Table of Contents
- Introduction
Course Information
Information about the Project
What I have done as part of the project
- Getting Started
- Contact
## Introduction
This repository was created as part of IBM's "Continuous Integration and Delivery (CI/CD)" course.
It's a project about building a CI/CD pipeline.
Much of the code was cloned from the IBM repository: https://github.com/ibm-developer-skills-network/vselh-ci-cd-final-project-template
Scenario: You’re part of a team responsible for building an innovative microservice, a RESTful API that allows users to manage and track counters.
Another team has already developed the user interface (UI) for this microservice,
and it's now your turn to ensure the reliability and efficiency of the backend services.
Tasks that need to be completed:
- Continuous Integration (CI) with GitHub Actions - Linting and testing
- Continuous Deployment (CD) with OpenShift Pipelines - Linting, testing, building an image and deploying the microservice to an OpenShift Cluster
Preview images of the project:



## Course Information
Title: Continuous Integration and Delivery (CI/CD)
Type: Final Project
Course Provider: IBM
## Information about the Project
### General
- Client: Myself
- Project Goal: Building a CI/CD pipeline. Gain a deeper understanding of Continous Integration and Continous Delivery.
- Number of Project Participants: 1 (Cloned repository of IBM. Developed the rest on my own)
- Time Period: December, 2024
- Industry / Area: DevOps
- Role: Developer
- Languages: English
- Result: CI/CD pipeline successfully built. Improved understanding of implementing Continous Integration and Continous Delivery.### Tech Stack
With regard to my role:
- CI/CD Tool: GitHub Actions
- CI/CD Tool: Tekton
- Container Orchestration: Kubernetes
- Container Orchestration: Red Hat OpenShift
- IBM Cloud IDE (based on Theia and Container)
## What I have done as part of the project
### Task 1 - CI with GitHub Actions
First the workflow YML file with the name of the workflow as well as the events, the job, the runner including the container and required steps were defined:
If you check the Actions tab on the GitHub website, you will see executed workflows:

After clicking on the build job, exact details of the individual steps can be viewed:

The logs show that everything is working perfectly.
The CD part can now be implemented.
### Task 2 - CD with Tekton and OpenShift
The next step is to create the CD workflow in OpenShift.
The cleanup task is added first that will clean the output workspace so that the CD pipeline can start fresh.
The corresponding YML file (/.tekton/tasks.yml):
The test task (with the testing framework nose) is added after the cleanup task:

Applying the new tasks to the cluster and verifying:

The pipeline is now built using the OpenShift Web Console.
A Workspace / PersistentVolumeClaim (PVC) is required for the tasks.
The creation of the PVC:
A pipeline including a workspace object was then created using the PVC.
The cleanup task in tasks.yml has been added to the pipeline and tested:

The logs show that everything is working perfectly.
Further tasks are added to the pipeline:
The pipeline is then executed and the logs are examined:


Again: The logs show that everything is working perfectly.
The final step of the pipeline: Deploying the application to the openshift cluster using the predefined 'openshift-client' task.
Pipeline is executed and the logs are examined:

Again: The logs show that everything is working perfectly.
As an additional test, the generated deployment / pod is also checked:
Status is 'Running', so everything fits.
The project has been successfully completed!
## Getting Started
After cloning you will need to run the `setup.sh` script in the `./bin` folder to install the prerequisite software.```bash
bash bin/setup.sh
```Then you must exit the shell and start a new one for the Python virtual environment to be activated.
```bash
exit
```
## Contact
If you have any questions, please feel free to reach out via email: christian-schwanse (at) gmx.net