Deployment Guide
Deployment Overview
RentOne uses Jenkins-based CI/CD pipelines for deploying backend microservices.
Deployment Flow:
GitHub Repository
│
▼
Jenkins Pipeline
│
▼
Maven Build
│
▼
Generate JAR
│
▼
Stop Existing Service
│
▼
Backup Existing JAR
│
▼
Deploy New JAR
│
▼
Start Service
│
▼
Verify Service Status
│
▼
Cleanup Workspace
Deployment Directory Structure
/var/www/backend/
├── backend-rentone-service-registry
├── backend-rentone-api-gateway
├── backend-rentone-tenants
├── backend-rentone-cloud-app
├── backend-rentone-users
├── backend-rentone-product-catalog
├── backend-rentone-inventory-system
├── backend-rentone-commerce-service
├── backend-rentone-payment-gateway
├── backend-rentone-file-mgmt
├── backend-rentone-notifications
├── backend-rentone-commerce-feedback-service
├── backend-rentone-operation-service
│
└── backups/
├── backend-rentone-service-registry
├── backend-rentone-api-gateway
├── backend-rentone-users
└── ...
Jenkins Deployment Process
Step 1 - Build Application
Generate executable JAR file.
mvn clean install
Step 2 - Stop Existing Service
Stop the currently running service.
sudo systemctl stop <service-name>
Step 3 - Create Backup
Create backup directory if it does not exist.
sudo mkdir -p /var/www/backend/backups/<service-name>
Backup current deployed JAR.
Example:
sudo cp \
/var/www/backend/<service-name>/app.jar \
/var/www/backend/backups/<service-name>/app_YYYYMMDD_HHMMSS.jar
Backup Naming Format:
app_20260623_154500.jar
Step 4 - Clean Deployment Directory
sudo rm -rf /var/www/backend/<service-name>/*
Step 5 - Deploy New JAR
sudo cp target/*.jar /var/www/backend/<service-name>/
Set ownership:
sudo chown -R shriccointernational:shriccointernational /var/www/backend/<service-name>
Rename:
sudo mv *.jar app.jar
Step 6 - Start Service
sudo systemctl start <service-name>
Step 7 - Verify Deployment
sudo systemctl status <service-name>
Expected Status:
active (running)
Step 8 - Cleanup Jenkins Workspace
Jenkins automatically cleans the workspace after every pipeline execution.
Backup Strategy
Every deployment automatically creates a backup of the currently running application.
Backup Location:
/var/www/backend/backups/<service-name>/
Example:
/var/www/backend/backups/backend-rentone-product-catalog/
├── app_20260621_120500.jar
├── app_20260622_094000.jar
└── app_20260623_143200.jar
This allows quick rollback to a previous stable version.
Rollback Procedure
Step 1 - Stop Service
sudo systemctl stop backend-rentone-product-catalog
Step 2 - List Available Backups
ls -ltr /var/www/backend/backups/backend-rentone-product-catalog/
Step 3 - Restore Required Version
Example:
sudo cp \
/var/www/backend/backups/backend-rentone-product-catalog/app_20260622_094000.jar \
/var/www/backend/backend-rentone-product-catalog/app.jar
Step 4 - Start Service
sudo systemctl start backend-rentone-product-catalog
Step 5 - Verify Status
sudo systemctl status backend-rentone-product-catalog
Deployment Verification Checklist
After every deployment verify:
✓ Jenkins pipeline completed successfully
✓ Service status is active (running)
✓ Service registered in Eureka
✓ API Gateway routing is working
✓ MongoDB connectivity is healthy
✓ Frontend can access APIs
✓ No errors in application logs
Useful Commands:
sudo systemctl status <service-name>
journalctl -u <service-name> -f
curl https://cloud.rentone.co.in