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.

Jenkins pipeline

  1. 01Check out the code from GitHub
  2. 02Build and package with Maven
  3. 03Run JUnit 5 and Mockito unit tests
  4. 04Publish the artifact to Nexus
  5. 05Build the Docker image and push it to Docker Hub
  6. 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

  • Jenkins
  • Git
  • GitHub
  • Maven
  • JUnit
  • Mockito
  • Nexus
  • Docker
  • Docker Hub
  • Docker Compose
  • Java 11
  • Spring Boot
  • Spring Data JPA
  • PostgreSQL
  • Spring Boot Actuator
  • OpenAPI / Swagger

NEXT PROJECT

SAEIV

A production platform for supervising autonomous shuttle and transport operations in real time.