This project demonstrates a simple Jenkins CI/CD pipeline using a Java program. The pipeline is implemented with a Jenkinsfile and showcases practical knowledge of Jenkins setup, pipeline creation, and GitHub integration.
The Java program simply prints "Hello World". The project covers:
- Writing a basic Java program.
- Creating a
Jenkinsfilefor pipeline automation. - Setting up Jenkins on an AWS EC2 instance.
- Cloning a GitHub repository into Jenkins.
- Building and executing the Jenkins pipeline successfully.
-
Java Program
- Wrote a simple Java program
HelloWorld.javathat prints "Hello World".
- Wrote a simple Java program
-
Jenkins Setup
- Launched an EC2 instance to host Jenkins.
- Installed Jenkins on the EC2 server.
- Installed necessary Jenkins plugins (Pipeline, Git, etc.).
-
Pipeline Job
- Created a Jenkins pipeline job.
- Connected the job to the GitHub repository containing the Java program and
Jenkinsfile.
-
Jenkinsfile
- Defined stages to:
- Clone the GitHub repository.
- Build and run the Java program.
- Used
agent anyto run the pipeline on any available agent.
- Defined stages to:
-
Build
- Triggered the pipeline build.
- All stages executed successfully, demonstrating a working CI/CD pipeline.
- Hands-on experience with Jenkins pipelines and
Jenkinsfile. - Knowledge of EC2 setup for Jenkins.
- Integration with GitHub repository for automated builds.
- Understanding of pipeline stages, agents, and job configuration.
- Clone this repository:
git clone https://github.com/samidha1-1/Java-CI-CD-Pipeline-with-Jenkins