Inventory Management - Full DevOps Pipeline
Spring Boot inventory API with a Jenkins → Docker → Ansible pipeline and Graphite + Grafana monitoring, built during the IBM DevOps course.
role
sole engineer
context
IBM DevOps, Agile & Design Thinking course
A Spring Boot inventory REST API wrapped in a DevOps setup: a Jenkins pipeline that builds, packages and dockerises it, an Ansible stage for deployment, and Micrometer metrics pushed to Graphite and viewed in Grafana. Built during the IBM DevOps, Agile & Design Thinking course (June–July 2025).
highlights
- Jenkins pipeline: checkout → build → test → package → Docker image → Ansible
- Multi-stage Dockerfile (Maven build, then a slim JRE image running as a non-root user)
- Micrometer metrics pushed to Graphite every 10 s, viewed in Grafana; Actuator health and metrics endpoints
- 11 REST endpoints: CRUD, search by name and category, low-stock and out-of-stock queries, inventory stats
the framing
The course asked for a DevOps pipeline around an application, so the app itself is a deliberately simple inventory API: products, categories, stock levels. Most of the work went into everything around it - building, packaging, containerising, and watching it run.
the pipeline
the jenkinsfile
stages {
stage('Checkout') { steps { checkout scm } }
stage('Build') { steps { sh 'mvn clean compile' } }
stage('Test') { steps { sh 'mvn test' } }
stage('Package') { steps { sh 'mvn package -DskipTests' } }
stage('Docker Build') { steps { script { docker.build("inventory-management-system:${BUILD_NUMBER}") } } }
stage('Deploy with Ansible') { steps { sh 'ansible-playbook -i ansible/inventory.ini ansible/playbook.yml --tags deploy' } }
}monitoring
Spring Boot Actuator exposes health, info, metrics and a Prometheus endpoint. Micrometer's Graphite registry pushes the app's metrics to Graphite every 10 seconds, and Grafana reads from Graphite. Docker Compose brings up the app, Graphite, Grafana and Jenkins together, so the whole stack runs locally with one command.
known gaps
- No unit tests yet - the pipeline has a Test stage and JUnit 5 is a dependency, but the test folder is empty
- The Ansible playbook is a placeholder that only proves Jenkins can trigger Ansible; it doesn't deploy the container yet
- The Jenkinsfile expects ansible/inventory.ini but the file is named inventory.imi, so that stage needs fixing before it runs
- The database is in-memory H2, so data resets on every restart
what i'd add next
Real unit and integration tests so the Test stage means something, an Ansible playbook that actually pulls and runs the image, a persistent database like PostgreSQL, and a Grafana dashboard exported as JSON so the monitoring setup lives in the repo too.