This project is a Scientific Calculator implemented in Java and containerized using Docker. It follows DevOps best practices by integrating Jenkins for CI/CD, Docker for containerization, and Ansible for local deployment.
- Mathematical Functions:
- Square Root (√x)
- Factorial (x!)
- Natural Logarithm (ln(x))
- Power Function (x^b)
- Dockerized for easy deployment
- Automated deployment using Ansible
- CI/CD Integration with Jenkins
Make sure you have the following installed:
- Java 11 or later
- Docker
- Ansible (for local deployment)
- Jenkins (for CI/CD automation)
- Git
git clone https://github.com/your-username/scientific-calculator.git
cd scientific-calculatorjavac -d . src/com/aman/ScientificCalculator.java
jar -cvf ScientificCalculator.jar -C . comjava -jar ScientificCalculator.jardocker build -t amanbh321/scientific-calculator:v3 .docker run -d --name scientific-calculator -p 9090:8080 amanbh321/scientific-calculator:v3docker psdocker logs scientific-calculatoransible-playbook deploy.ymlThis will:
- Start the Docker service
- Pull the latest Docker image
- Stop any existing container
- Deploy the updated version
If Jenkins is configured, the following happens on git push:
- Jenkins Pulls Latest Code
- Builds Docker Image
- Pushes to DockerHub
- Deploys using Ansible
docker exec -it scientific-calculator /bin/bash
java -jar /app/ScientificCalculator.jarhttp://localhost:9090
docker stop scientific-calculator
docker rm scientific-calculatordocker logs scientific-calculatorsudo systemctl restart dockerdocker rm -f scientific-calculator
docker rmi amanbh321/scientific-calculator:v3
docker build -t amanbh321/scientific-calculator:v3 .
docker run -d -p 9090:8080 amanbh321/scientific-calculator:v3Aman Bahuguna