I recently built a local CI/CD pipeline using Jenkins to deploy a Spring Boot application with Docker, simulating dev and QA environments. The twist? I did it entirely on Windows, using the bat command — no Git Bash or Linux dependencies!
🛠️ Stack & Tools
- Jenkins (installed via Windows installer)
- Spring Boot (Maven project)
- Docker Compose (for dev & qa services)
- GitHub (source control with PAT for authentication)
-
Windows batch scripts (
bat) for Jenkins steps
🔄 Pipeline Overview
My Jenkins pipeline does the following:
Pulls code from GitHub (set to
mainbranch manually)Builds the Spring Boot app using:
dir('backend') {
bat 'mvnw.cmd clean package -DskipTests'
}
Builds Docker images for both dev and QA
Deploys the dev container
Adds a manual input step before proceeding to QA deployment
🧪 Environments Setup with Docker Compose
Here’s a snapshot from my docker-compose.yml:
services:
backend-dev:
build: ./backend
ports:
- "8082:8080"
environment:
- SPRING_PROFILES_ACTIVE=dev
backend-qa:
build: ./backend
ports:
- "8083:8080"
environment:
- SPRING_PROFILES_ACTIVE=qa
Each profile (application-dev.properties, application-qa.properties) gets picked up based on SPRING_PROFILES_ACTIVE.
⚠️ What I Learned
- Jenkins on Windows uses
bat, notsh - Use
mvnw.cmdinstead of./mvnw - Make sure the
backenddirectory exists in your GitHub repo, or Jenkins will break - GitHub no longer supports password auth — use a Personal Access Token
- Docker
COPY target/*.jarfails if the app isn’t built first!
✅ Next Goals
- Add frontend (React)
- Push images to GitHub Container Registry
- Setup GitHub webhook to auto-trigger Jenkins
💬 Final Thoughts
This was my first fully local pipeline and it’s taught me more than any tutorial could. If you’re starting with Jenkins, don’t be afraid to break things — just read the logs carefully and keep experimenting.
Feel free to connect if you're working on something similar!
#Jenkins #SpringBoot #DevOps #Docker #CI_CD #Java #WindowsDeveloper #Tutorial #BuildInPublic
Top comments (0)