Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ezhilezhil/calculator
A powerful Java-based calculator integrated with a Jenkins CI/CD pipeline to automate the development process. This project demonstrates seamless integration of code compilation, unit testing, static analysis, and code coverage metrics to ensure high-quality software delivery.
https://github.com/ezhilezhil/calculator
calculator devops jenkins pipeline
Last synced: about 1 month ago
JSON representation
A powerful Java-based calculator integrated with a Jenkins CI/CD pipeline to automate the development process. This project demonstrates seamless integration of code compilation, unit testing, static analysis, and code coverage metrics to ensure high-quality software delivery.
- Host: GitHub
- URL: https://github.com/ezhilezhil/calculator
- Owner: ezhilezhil
- Created: 2024-10-14T12:26:26.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-30T04:13:33.000Z (about 1 month ago)
- Last Synced: 2024-11-30T04:25:27.952Z (about 1 month ago)
- Topics: calculator, devops, jenkins, pipeline
- Language: Java
- Homepage: https://jenkins-pipeline-guide.netlify.app
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π **Calculator Project**
A robust and efficient **Java-based Calculator**, seamlessly integrated with **Jenkins CI/CD Pipelines** for continuous integration, testing, and deployment. This project is a great example of using automation to ensure code quality and reliability.
---
## π **Key Features**
β¨ Perform basic arithmetic operations: **Addition, Subtraction, Multiplication, Division**
β¨ Automated **Unit Testing** with JUnit for reliability
β¨ Integrated **Static Code Analysis** for quality assurance
β¨ Comprehensive **Code Coverage** metrics with JaCoCo
β¨ End-to-end **CI/CD Pipeline** with Jenkins for automation---
## π οΈ **Jenkins Pipeline Workflow**
The Jenkins pipeline consists of multiple automated stages to ensure a smooth CI/CD process:
| **Stage** | **Description** |
|----------------------|---------------------------------------------------------------------------------|
| **1. Setup** | Cleans the workspace and prepares the environment |
| **2. Compile** | Compiles the Java code to ensure itβs error-free |
| **3. Static Analysis**| Analyzes code quality using tools like **SonarQube** or **Checkstyle** |
| **4. Unit Test** | Runs JUnit test cases to validate functionality |
| **5. Code Coverage** | Measures code coverage with **JaCoCo**, ensuring a high-quality codebase |
| **6. Build Artifact**| Generates a deployable JAR file |
| **7. Deployment** | Optionally deploys the artifact to staging/production (if configured) |---
## π **Technologies & Tools Used**
- **Language**: Java
- **Build Tool**: Maven
- **CI/CD Tool**: Jenkins
- **Testing Framework**: JUnit
- **Code Coverage**: JaCoCo
- **Static Analysis**: SonarQube (Optional)---
## π **Prerequisites**
Before you begin, ensure you have the following installed on your system:
βοΈ **Java JDK** (v8 or above)
βοΈ **Maven** (v3.6 or above)
βοΈ **Jenkins** (v2.0 or above)
βοΈ Optional: SonarQube for static analysis---
## π **Getting Started**
Follow these steps to set up the project on your local machine:
### 1οΈβ£ Clone the Repository
```bash
git clone https://github.com/ezhilezhil/Calculator.git
```### 2οΈβ£ Navigate to the Project Directory
```bash
cd Calculator
```### 3οΈβ£ Build the Project
```bash
mvn clean install
```### 4οΈβ£ Run the Application
```bash
java -jar target/calculator.jar
```---
## π§ **Setting Up Jenkins**
To automate the project using Jenkins:
1. **Clone Repository in Jenkins**:
- Configure Jenkins to clone the repository using the Git URL.2. **Set Up Pipeline**:
- Create a pipeline with the stages outlined in the **Pipeline Workflow** section.3. **Configure Maven in Jenkins**:
- Go to `Manage Jenkins > Global Tool Configuration` and set up Maven.4. **Optional**: Add SonarQube and JaCoCo integration for better analysis and coverage.
---
## π **Project Structure**
```plaintext
Calculator/
βββ src/
β βββ main/
β β βββ java/
β β βββ com.example.calculator/
β β βββ Calculator.java # Core logic
β βββ test/
β βββ java/
β βββ com.example.calculator/
β βββ CalculatorTest.java # Unit tests
βββ pom.xml # Maven configuration
βββ README.md
```---
## π **Screenshots**
### Jenkins Pipeline View
![WhatsApp Image 2024-10-19 at 12 09 25](https://github.com/user-attachments/assets/1996bf52-614b-4c70-a66a-1ec2a8280a36)---
## π **Future Enhancements**
- β Add support for **advanced mathematical operations** like square root, logarithms, etc.
- π₯οΈ Build a **GUI/Web-based interface** for better usability.
- π¦ Integrate with **Docker** for containerized builds and deployments.---
## π **License**
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
---
**π‘ Tip**: You can explore how CI/CD workflows can improve software development speed and quality. Happy coding! π