This repository contains the Continuous Integration and Continuous Deployment (CI/CD) pipeline for the EMS project. The pipeline is set up using Jenkins, and it automates the process of building and testing the application. This document outlines the steps to run the pipeline and troubleshooting tips for common issues.
The pipeline is designed to perform the following stages:
- Checkout:
- The latest code is pulled from the repository using Git.
- Build:
- Dependencies from the
requirements.txt
file are installed usingpip
.
- Dependencies from the
- Test:
- The project is tested using pytest. Any failing tests will cause the pipeline to fail.
These stages are defined in the Jenkinsfile
located at the root of the repository.
- Jenkins should be installed and configured.
- You need GitHub credentials set up in Jenkins for the repository.
- Ensure the following plugins are installed in Jenkins:
- Git Plugin
- Pipeline Plugin
- SSH Pipeline Steps
-
Clone the repository to your Jenkins server (or configure your Jenkins job to pull from GitHub directly).
-
Create a new Jenkins pipeline job:
- Go to
Jenkins Dashboard > New Item > Pipeline
. - Enter a name for the job (e.g.,
EMS-CI-CD
). - Under
Pipeline
, choosePipeline script from SCM
. - Select the Git option and enter the repository URL.
- Set the branch to
main
(or your relevant branch). - Specify the
Jenkinsfile
path if it is not in the root directory.
- Go to
-
Trigger the pipeline:
- The pipeline will run automatically after a commit is made to the repository (if webhooks are configured).
- Alternatively, you can manually trigger the pipeline by clicking on
Build Now
from the Jenkins dashboard.
For more detailed information on setting up and managing Jenkins pipelines, refer to the Jenkins documentation.