https://github.com/lamiaaali/depi-devops-grad-project
https://github.com/lamiaaali/depi-devops-grad-project
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lamiaaali/depi-devops-grad-project
- Owner: lamiaaali
- Created: 2024-10-15T21:22:51.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-12-03T07:41:18.000Z (7 months ago)
- Last Synced: 2025-04-05T18:40:49.807Z (3 months ago)
- Language: CSS
- Size: 10.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# java maven app pipeline
this project is to build spring-pet-clinic app with jenkins pipeline and push final image to docker hub repo.
with increment version stage to edit pom.xml file with new version number and assign it to docker image tag.
setting up infrastructure with Terraform and Configuration with Ansible.## docker compose file to specify services and its replicas and its configurations:
* pet-app service to run five replicas of the app.
* mysqldb service to run mysql database to store pet-app data.
* balancer service to run nginx container with its default.conf file to work as a load balancer for the five replicas.## requirements:
* git
* Docker
* Ansible
* Terraform
* Jenkins## Tools
- git
- Docker & Docker compose
- nginx as load Balancer
- Jenkins CICD
- Terraform
- Ansible## Jenkinsfile
* "increment version" stage to change old version in pom.xml file to the new version:
* "build jar" stage to build jar file for the app with clean option to clean the target directory from old version of app:
* "test" stage to test app using maven build tool with when condition to specify make the test or skip:
* "build&push image" stage to build docker image, login dockerhub using and push the image with the new version:
* "push pom.xml file" stage to push pom.xml file that contains the new version to github repo to make it valid for next build:
## dockerhub repo after successful builds
## nginx configuration to work as a load balancer and store logs for app:

### part of logs file that show IPs of app container that traffic is balanced with upstream method:
deployscript.sh file :
it is bash script to install docker and git then run docker compose file to deploy services.## to clone this repo :
'''bash
git clone https://github.com/rashadahmed424/java-pet-clinic-app-pipeline.git
'''## Run Locally
Clone the project
```bash
git clone https://github.com/rashadahmed424/java-pet-clinic-app-pipeline.git
```Go to the project directory
```bash
cd java-pet-clinic-app-pipeline
```Start services
```bash
docker compose -f dockercompose.yaml up --build -d
```