This repository demonstrates a Python project with a CI/CD pipeline using Jenkins. The pipeline includes creating a virtual environment, installing dependencies, running tests with coverage, and generating test and coverage reports.
- Jenkins installed on your system or server. (You can utilize this EC2 userdata to setup the jenkins and python https://github.com/cvamsikrishna11/devops-fully-automated/blob/installations/jenkins-maven-ansible-setup.sh)
- Python 3.x installed on your Jenkins build agent.
- Cobertura Plugin
- JUnit Plugin
- Code Coverage API Plugin
To install the required plugins, follow these steps:
- Go to your Jenkins dashboard and click on "Manage Jenkins" in the left sidebar.
- Click on "Manage Plugins."
- In the "Available" tab, search for "Cobertura", "Code Coverage API Plugin" and "JUnit."
- Check the boxes next to "Cobertura Plugin", "Code Coverage API Plugin" and "JUnit Plugin," then click "Install without restart" or "Download now and install after restart."
- Clone this repository to your local machine.
- In Jenkins, create a new Pipeline job.
- In the Pipeline job configuration, select "Pipeline script from SCM" under the "Pipeline" section.
- Choose "Git" as the SCM and enter the URL of your repository (https://github.com/cvamsikrishna11/python-cicd-repo.git).
- Save the job configuration.
- Click "Build Now" in your Jenkins Pipeline job to start the build process.
- Monitor the build progress in the "Console Output" of the running build.
- Once the build is completed, you can view the test and coverage reports in the "Test Result" and "Cobertura Coverage Report" sections of the build page.
For additional help or questions, please open an issue in the repository or reach out to the repository owner.