CASE STUDY 06 / ACADEMIC / DEVOPS
DevOps CI/CD — Pipeline for a Spring Boot Stock Management API
Academic project · ESPRIT
A Spring Boot stock management API delivered through a Jenkins CI/CD pipeline: Maven build, unit tests, a Nexus artifact repository, a Docker image and a Docker Compose deployment.
- SOURCEGitHubVersioned source code
- CIJenkinsPipeline orchestration
- BUILD & TESTMaven · JUnit · MockitoBuild and unit tests
- ARTIFACTSNexusVersioned releases
- IMAGEDocker HubApplication image
- DEPLOYDocker ComposeAPI with PostgreSQL
Jenkins pipeline
- 01Check out the code from GitHub
- 02Build and package with Maven
- 03Run JUnit 5 and Mockito unit tests
- 04Publish the artifact to Nexus
- 05Build the Docker image and push it to Docker Hub
- 06Deploy with Docker Compose and PostgreSQL
Goal
Automate the path from a code change to a running container for a Spring Boot application, with tests and versioned artifacts along the way.
The Application
A layered Spring Boot 2.7 / Java 11 REST API for stock management: products, stock, suppliers, invoices and their details, operators and activity sectors, persisted in PostgreSQL with Spring Data JPA and documented with OpenAPI.
CI/CD with Jenkins
A Jenkins pipeline orchestrates the delivery: it checks out the repository, builds the application with Maven, runs the unit tests, publishes the versioned artifact to a Nexus repository, then builds a Docker image and pushes it to Docker Hub.
Testing
Service-layer unit tests use JUnit 5 and Mockito: repositories are mocked so the business logic is verified in isolation, with a dedicated test configuration.
Containerised Deployment
Docker Compose runs the application image next to a PostgreSQL container with a persistent volume, a restart policy and configuration passed through the environment. Spring Boot Actuator exposes the health endpoint.
Tech Stack
NEXT PROJECT
SAEIV
A production platform for supervising autonomous shuttle and transport operations in real time.